Tuesday, November 1, 2011

JSTL usage

Collection of JSTL:
${status.index} = 0 based index
${status.count} = 1 based index
${status.first} and ${status.last}

<c:choose>
  <c:when test="${hasResult}">
     <c:forEach var="trackGroup" items="${trackHistoryGroupList}">                                 
        <c:forEach var="track" items="${trackGroup}" varStatus="status"> 
          <c:if test="${status.first}">          
            ${track.groupId} | ${track.displayName} | ${track.startTime}
          </c:if>
          | ${track.latitude} | ${track.time}  
        </c:forEach>             
     </c:forEach>
   </c:when>
   <c:otherwise>
     No track available to view
   </c:otherwise>
</c:choose> 


<c:forEach var="i" begin="1" end="24" step="1" varStatus ="status">
<c:out value="${i}" /> 
</c:forEach>

No comments:

Post a Comment