Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

varstatus foreach jsp

/*Using varStatus attribute which holds loop status, we can perform
loop operations like checking whether the current iteration is the last 
iteration etc.*/
//Example
<c:forEach items="${schools}" var="school"  varStatus="status">
    School from index 4 until index 8: ${school}
    ${not status.last ? ‘<hr/>’ : ‘<br/>’}
</c:forEach>
<div class="open_grepper_editor" title="Edit & Save To Grepper">
</div>
/*In the above example we are displaying school names with horizontal line for 
each school name. We avoided horizontal line for the last school name instead 
we had given a line break for the last item.*/
Source by mail.codejava.net #
 
PREVIOUS NEXT
Tagged: #varstatus #foreach #jsp
ADD COMMENT
Topic
Name
1+7 =