Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Struts
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Jeanne Boyarsky
Ron McLeod
Paul Clapham
Liutauras Vilda
Sheriffs:
paul wheaton
Rob Spoor
Devaka Cooray
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Carey Brown
Frits Walraven
Tim Moores
Bartenders:
Mikalai Zaikin
Forum:
Struts
<s:iterator
Rohit Rai
Ranch Hand
Posts: 53
posted 13 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hi,
How do i reverse iterate using OGNL. Say i have the following
<s:iterator status="stat" value="{1,2,3,4,5}" > <s:property value="#stat.index" /> <s:property value="top" /> </s:iterator>
Now i want to traverse from 5,4,3,2,1 etc.
It's something like doing the below:
for(int i = 5 ; i>=0 ; i--) { System.out.println(i); }
Any idea how to do this?
Aneesh Vijendran
Ranch Hand
Posts: 125
posted 13 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Why don't you do:
<s:iterator status="stat" value="{5,4,3,2,1}" > ... ...
Cheers
Aneesh
David Newton
Author
Posts: 12617
I like...
posted 13 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
There are a number of ways to do this depending on how clever you want to get. Check out the existing collection tags for info. Could also do something tricky via OGNL--check out the OGNL docs. Or just reverse it on the
Java
side.
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
how to use ONGL ?
how to display mysql table datas in jsp using struts2
Struts 2 iterating enums
Struts iterator tag value attribute
Struts2 Iteator Tag with object in object
More...