The following jsp prints nothing for the first <c:forEach> loop but "1 2" for the second. <%@ taglib uri="/WEB-INF/c.tld" prefix="c" %> <html> <head> <title>Test</title> </head> <body> <c:forEach begin="1" end="1" varStatus="loop" > <c:out value="${loop.index}" /> </c:forEach><br /> <c:forEach begin="1" end="2" varStatus="loop" > <c:out value="${loop.index}" /> </c:forEach><br /> </body> </html>
Works for me using JSTL 1.0.3.
The expected result of the jsp would be: 1 1 2 The actual result was (even in JSTL 1.0.3): 1 2
Hi Ari, I tested it on my laptop (running Mandrake Linux, Tomcat 4.1.24 and Standandard 1.0.3) and it worked as expected. Here is the output: <html> <head> <title>Test</title> </head> <body> 1 <br /> 1 2 <br /> </body> </html>
PS: forgot to ask: what's the environment you are testing? Did you try on Tomcat 4.1.24? Felipe
Re-tested, and this once again works fine for me. Since this was also confirmed by Felipe, I'll go ahead and close this bug again (getting ready for a new release). I'd however suggest the following: - Test with Tomcat 4.1.x and JSTL 1.0.3 to convince yourself that this works - Try to understand the difference between your environment and the one suggested above where this works
I'm seen the same bug in the JSTL 1.0.3 impl on Resin. To my knowledge, Tomcat doesn't efficiently recycle tags, so maybe there's something there. I'll scan the code and if there's anything I think is suspicious, I'll let you know.
I was using Resin. It has its own implementation of javax.servlet.jsp.jstl.core.LoopTagSupport. When I forced the use of jakarta implementation of that class all worked fine.