tokhi tokhi - 1 year ago 108
Java Question

for loop to jstl forEach

How to convert below

loop to a

for(int i = 0 ; i<=21; i+=3){
// print foo

This is what I have so far:

<c:forEach varStatus="loop" begin="0" end="21">
// display foo

Answer Source

Acoording to jstl you should try:

<c:forEach begin="0" end="21" step="3" varStatus="loop">
    <c:out value="${loop.count}"/>
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download