This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Doubt on Tags Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Doubt on Tags" Watch "Doubt on Tags" New topic
Author

Doubt on Tags

Padma priya Gururajan
Ranch Hand

Joined: Oct 05, 2006
Posts: 434
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: 14687
    
  16

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: 434
Hi,
I am talking about c:forEach tags.

Thanks in advance.
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

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: 434
Hi Verre,

Thanks.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Doubt on Tags
 
Similar Threads
Iteration custom tag
Iteration EL tags
JSTL
JSTL question
mock exam jstl core iteration custom tags