I have been working with ASP.NET for a few years and am now working on a project using JSP, Struts, and Java so I am fairly new to this.
I have a for-loop in a JavaScript function that looks something like this:
<% int count=0; %>
for(i = 0; i < arrayCount; i++){
jsArray[i] = <%= myBeanArrayList.get(count) %>;
alert("i = " + i + "count = " + count);
<% count++; %>
}
The count variable doesn't increment even if I use <% count = count + 1 %>. I don't understand why that piece of code doesn't do as I want inside the loop. Does anyone have any suggestions on how I can increment the count for the JSP Bean?