Mantis - Resin
|
|||||
Viewing Issue Advanced Details | |||||
|
|||||
ID: | Category: | Severity: | Reproducibility: | Date Submitted: | Last Update: |
121 | minor | always | 04-25-05 00:00 | 05-11-05 00:00 | |
|
|||||
Reporter: | sam | Platform: | |||
Assigned To: | OS: | ||||
Priority: | normal | OS Version: | |||
Status: | closed | Product Version: | 3.0.12 | ||
Product Build: | 3.0.12 | Resolution: | fixed | ||
Projection: | none | ||||
ETA: | none | Fixed in Version: | 3.0.13 | ||
|
|||||
Summary: | 0000121: c:forEach NoSuchElementException with len mod step != 0 | ||||
Description: |
RSN-112 (rep by T Palmer) The problem I found is when using the JSTL tag c:forEach with items and with step > 1 (where the number of items is not divisible by the step). For instance, this (using indexes rather than items) works: <c:forEach var="index" begin="0" end="${fn:length(someWords)}" step="3"> This does not: <c:forEach var="item" items="${someWords}" step="3"> At the end of the iteration (if it doesn't line up perfectly), you get a NoSuchElementException. This is the compiled code that causes the problem: for (int _jsp_si_3 = _jsp_step_3; _jsp_si_3 > 1; _jsp_si_3--) _jsp_iter_3.next(); There is no check for whether the next element exists. I think that the behavior of this situation isn't incredibly explicit in the JSTL (1.1) spec, but I would expect it to complete without an exception just as in the case of the index looping mentioned earlier. |
||||
Steps To Reproduce: | |||||
Additional Information: | |||||
Relationships | |||||
Attached Files: |
Notes | |||||
|
|||||
|
|