Infinite Loop in JSP FOR Statement
843835Aug 3 2002 — edited Aug 5 2002Hi,
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>
<% } %>
....