I'm trying to figure out, in a jsp, how to loop through an array contained in a bean that's forwarded from a servlet to the jsp.
I can access individual array elements like so:
${key.myarr[0]}
${key.myarr[1]}
But I can't seem to use a variable for the array subscript. What I want to accomplish is something like this:
<% for (int i = 0; i < 10; i++){ %>
${key.myarr[<%= i %>]}
<% } %>
But it doesn't accept this way of specifying the subscript, nor several other ways I've tried it. Does anyone know how to do this?
Thanks..