Hi...
I am using Struts in my application. In one of my pages I am using core JSTL tag to 
iterate a set of collection object (2 rows displayed per page) along 
with next and previous links so that the other results could be viewed on the click of 
next... The code is as follows...
 
<c:set var="noOfRows" value="2" />
<c:forEach  var="actual" items="${loginForm.clientCollection}" begin="${param.first}" 
end="${param.first + noOfRows - 1}">
<tr>
 <td>
  <c:out value="${actual.name}"/><br>
 </td>
 <td>
  <c:out value="${actual.password}"/><br>
 </td>              
</tr>
</c:forEach>
 
 
<c:choose>
 <c:when test="${param.first > 0}">
 <a href="confirm.jsp?first=<c:out value="${param.first - noOfRows}"/>">Previous</a>
 </c:when>
 <c:otherwise>&nbsp;</c:otherwise>
</c:choose>
<c:choose>
 <c:when test="${param.first + noOfRows < 5}">
 <a href="confirm.jsp?first=<c:out value="${param.first + noOfRows}"/>">Next</a>
 </c:when>
 <c:otherwise>&nbsp;</c:otherwise>
</c:choose>         
                                                                           
The first time when the page gets displayed the 2 rows are displayed with values and 
with a 'next' link... When I click on next, I get no results -- I guess at this 
moment, 
the collection is empty though the param.first takes the value 2!! Is there anything I 
am missing??? Kindly advice...
 
-Jacob


---------------------------------
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search

Reply via email to