Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Infinite Loop in JSP FOR Statement

843835Aug 3 2002 — edited Aug 5 2002
Hi,
I am having some problems when using variables (for() loops) in JSPs. It appears that the evaluation in the for statement isn't functioning properly thus causing an infinite loop. I have debug statements which show that the evaluation should have failed(icounter > notesList.size()). This behaviour is observed in a Solaris/iplanet environment and doesn't happen all the time.

In the below snippet - notesList is a Vector and its size is 3. When this code is run an infinite loop "MAY" occur. icounter sometimes increases past notesList.size(). Any Ideas?????


....
<%
for (int icounter = 0; icounter < notesList.size(); icounter++) {
NoteBean bean = (NoteBean) notesList.elementAt(icounter);
%>
<TR>
<TD VALIGN="TOP" HEADERS="ROW<%= icounter %>" ID="NOTEROW<%= icounter %>">
<%= bean.getRecordUpdateDt() %>
</TD>
</TR>
<% } %>
....
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 2 2002
Added on Aug 3 2002
4 comments
239 views