File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes How to increment count in S:iterator tag Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "How to increment count in S:iterator tag" Watch "How to increment count in S:iterator tag" New topic
Author

How to increment count in S:iterator tag

Saurabh Naik
Ranch Hand

Joined: Apr 24, 2008
Posts: 87
Hello

I have an arraylist<String>. I am using s:iterator tag to display it. But I want to display 2 items at a time.
Is there any way to show 2 items at one iteration. How can I increment current count within iteration and display next item within arraylist.


SCJP 6 (88%), SCWCD 5 (78%), preparing for SCBCD
Mohana Rao Sv
Ranch Hand

Joined: Aug 01, 2007
Posts: 485

Struts2 IteratorTag



ocjp 6 — Feeding a person with food is a great thing in this world. Feeding the same person by transferring the knowledge is far more better thing. The reason is the amount of satisfaction which we get through food is of only one minute or two. But the satisfaction which we can get through the knowledge is of life long.
Saurabh Naik
Ranch Hand

Joined: Apr 24, 2008
Posts: 87
Thanks for the reply

But I dont want it this way. I simply want to print next values in same iteration.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: How to increment count in S:iterator tag
 
Similar Threads
How to display the last item of a select box as default
Is it possible to have a selectManyListBox within <ui:repeat> ?
Sticky nested lists problem in Struts 2
Struts 2 - Setting and Incrementing integers in jsps
iterator in struts 2 using nested ArrayList