| Author |
Doubt on Tags
|
Padma priya Gururajan
Ranch Hand
Joined: Oct 05, 2006
Posts: 411
|
|
In Enthuware, it is mentioned that for looping over collections, a loop status object might be used in the tag body. How do we use the loop status object in the tag body? Thanks in advance.
|
Padma priya N.G.
Be the change you want to be - Mahatma Gandhi
|
 |
Christophe Verré
Sheriff
Joined: Nov 24, 2005
Posts: 14670
|
|
|
Which tags are you talking about ? JSTL's iteration tags ? (c:forEach, c:forTokens)
|
[My Blog]
All roads lead to JavaRanch
|
 |
Padma priya Gururajan
Ranch Hand
Joined: Oct 05, 2006
Posts: 411
|
|
Hi, I am talking about c:forEach tags. Thanks in advance.
|
 |
Christophe Verré
Sheriff
Joined: Nov 24, 2005
Posts: 14670
|
|
How do we use the loop status object in the tag body?
There is a varStatus attribute in the c:forEach tag. It's type is javax.servlet.jsp.jstl.core.LoopTagStatus. If you look at the LoopTagStatus API, you'll see that the following information is available : begin, count, current, end, index, step. For example, the following will print the iteration count next to an album title :
|
 |
Padma priya Gururajan
Ranch Hand
Joined: Oct 05, 2006
Posts: 411
|
|
Hi Verre, Thanks.
|
 |
 |
|
|
subject: Doubt on Tags
|
|
|