[struts2]jstl标签用法技巧

1.<c:if test="${var} != null"></c:if>

2.

  <c:foreach var="singleVar" items="" varStatus="states"></c:foreach>

  <c:if test="${states.index%2=0}"></c:if>

  <c:if test="${states.index%2=1}"></c:if>

  <c:if test="${states.last}"></c:if>

3.

<c:choose> 

  <c:when test="${empty param.username}">   

    Nnknown user.  

  </c:when> 

  <c:when test="${param.username=='Tom'}">   

    ${param.username} is manager.  

  </c:when> 

  <c:otherwise>   

    ${param.username} is employee.  

  </c:otherwise> 

</c:choose> 

原文地址:https://www.cnblogs.com/luoxiaolei/p/5140784.html