[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> 

posted on 2016-01-18 23:12  Simle  阅读(282)  评论(0编辑  收藏  举报