I have an array of strings. Lets say array[] containing 5 strings: "a", "b", "c", "d", "e" Now I want to display only strings at position 3 and 4 in the jsp file. How do I do that with s:iterator tag ? (just like a normal for loop starting at 3 and ending at 4)
Is there a way to loop with s:iterator with a begin and end value just like a normal loop ?
Thanks!
Why not just use iterator tag with begin and end attributes.
Example from Struts2 tag reference:
<s:iterator value="{1,2,3,4,5}" begin="2" end="4" >
<!-- current iteration value (2,3,4) -->
<s:property value="top" />
</s:iterator>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With