Tuesday, January 24, 2012

Getting the List size in JSP

${fn:length(list)}


<c:set var="endLoop" value="${offset + maxPageItems}"/>  
    <c:if test="${fn:length(searchResults) < endLoop}"> 
      <c:set var="endLoop" value="${fn:length(searchResults)"/> 
    </c:if> 
    <c:forEach items="${searchResults}" var="searchResult" varStatus="searchIndex" begin="${offset}" end="${endLoop}">  
      <td>${result.city}</td> 
    </c:forEach>

No comments:

Post a Comment