JSTL c:forEach, decremental number loop impossible?

Viewed 20060

I want to print decremental numbers like:

<c:forEach var="i" begin="10" end="0" step="-1">
    ... ${i} ...
</c:forEach>

then I got jsp exception:

javax.servlet.jsp.JspTagException: 'step' <= 0
    javax.servlet.jsp.jstl.core.LoopTagSupport.validateStep(LoopTagSupport.java:459)
    org.apache.taglibs.standard.tag.rt.core.ForEachTag.setStep(ForEachTag.java:60)
    ....

but this answer says it is possible to loop in both ways:

JSTL forEach reverse order

What's wrong with me?

2 Answers
Related