Apache Struts 2 Documentation > Home > FAQs > How can I iterate over a range, like with JSTL's forEach tag?
Added by Laurie Harper, last edited by Laurie Harper on Jun 17, 2008

One solution is to just use the c:forEach tag. If you are on an older servlet container which doesn't make JSTL available by default and don't want to add it as an additional dependency, though, it is possible to do this with Struts' s:iterator tag and an OGNL generator expression:

<s:iterator value="(10).{ #this }"><s:property/></s:iterator>