A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
this week in the
JSTL forEach syntax
Joined: Apr 06, 2008
Apr 09, 2008 22:16:00
In the forEach syntax what does varstatus means
Joined: Dec 06, 2004
Apr 09, 2008 22:44:00
"varstatus" attribute in forEach will give you an index of the element in iterating List.
For first iteration its value will be 1
For second iteration its value will be 2..
Balasubramani SD,<br />SCJP 1.4,SCWCD 1.4,SCJP 5.0<br /><a href="http://sd.balasubramani.googlepages.com" target="_blank" rel="nofollow">www.sd.balasubramani.googlepages.com</a>
Joined: Nov 24, 2005
Apr 09, 2008 22:47:00
It's a bit more than that. varStatus gives you access to a scoped variable whose type is javax.servlet.jsp.jstl.core.LoopTagStatus.
If you look at this class
, you'll see that it allows you to get more information about the loop.
All roads lead to JavaRanch
Joined: Feb 22, 2005
Apr 09, 2008 23:30:00
I'd also recommend this
for clearing up any doubts you might have about the for-each tag. All attributes of this tag are quite clearly explained.
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link:
subject: JSTL forEach syntax
Getting a typed Iterator for Generics
logic:iterate for counter
EL with List of Objects
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2015