Great! Thanks a lot for this, it was needed.
Musachy Barroso wrote: > > Ok, here is the Jira ticket: > > https://issues.apache.org/struts/browse/WW-2984 > > I committed the changes to the iterator tag, here is how it works: New > attributes "begin", "end" and "step" were added. They can be used by > themselves, or with List and Arrays, like: > > <s:iterator begin="1" end="5" step="2" > > ... > <s:iterator begin="5" end="1" step="-1" > > ... > <s:iterator begin="1" end="5" step="2" value="myList"> > ... > <s:iterator begin="5" end="1" step="-1" value="myArray"> > > Things to consider (let me make sure that google gets this :)): > > * When "values" is specified with "begin", then "value" must point to > a List or an Array > * The "end" attribute is inclusive, just like in JSTL, if a List/Array > is used, "end" is optional, and it will default to the size of the > List/Array, or to 0 if "step" is negative. > * If "step" is negative, then "begin" must be greater than "end" > > I think that covers most of the use-cases. Testing is welcome (I added > a bunch of tests to IteratorTagTest). > > musachy > > > > -- View this message in context: http://www.nabble.com/s%3Aiterator-%C2%BFbegin--%3E-end--tp21832209p21858888.html Sent from the Struts - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org