Bug 13016

Summary: bug in forEach tag
Product: Taglibs Reporter: Peter Illes <peter.illes>
Component: Standard TaglibAssignee: Tomcat Developers Mailing List <dev>
Status: RESOLVED WORKSFORME    
Severity: major    
Priority: P3    
Version: 1.0   
Target Milestone: ---   
Hardware: Sun   
OS: Linux   

Description Peter Illes 2002-09-26 07:55:14 UTC
The forEach tag is wrong when iterating in 'fixed number of times' mode. When
'begin' parameter equals the 'end' parameter, it doesn't evaluate at all. When
'end' is 'begin' + 1, it iterates twice as should iterate towards 'end' inclusive.
This means it's not possible to iterate once.
Comment 1 Shawn Bayern 2002-09-26 13:22:19 UTC
I can't replicate the problem.  Consider the following examples:

<c:forEach begin="0" end="0">
 Loop! <br />
</c:forEach>

<c:forEach begin="0" end="1">
 Loop! <br />
</c:forEach>

For me, the first loop executes once, and the second executes twice.

If you're still having a problem, please be more specific; post an entire page 
of input and output, and specify the container that you're running in.