Forums Register Login

Convert to EL

+Pie Number of slices to send: Send
Please can someone tell me how I can change the following code to using EL instead of scriptlet? I think you can get the attribute from the request using ${sessionStats} bu how do you iterate over the 2d array?

<%String[][] temp = (String[][])request.getAttribute("sessionsStats");%>
<% for(int i = 0; i < temp.length; i ++){%><tr> <td align="center"><%=temp[i][0]%></td>
<td align="center"><%=temp[i][1]%></td>
<td align="center"><%=temp[i][2]%></td>
<td align="center"><%=temp[i][3]%></td>
<td align="center"><%=temp[i][4]%></td>
<td align="center"><%=temp[i][5]%></td>
<td align="center"><input type="checkbox" name="invalidateSession" value="<%=temp[i][0]%>"/></td>
</tr>
<%}%>
+Pie Number of slices to send: Send
The same way you would in Java, with a nested for loop, except in this case, it'd be nested <c:forEach> actions.
Beware the other head of science - it bites! Nibble on this message:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 907 times.
Similar Threads
Forms in servlet
how to iterate a arraylist and print values in table using logic:iterate
passing values to a pop up window (SOS)
How to validate that in each row how many checkboxes are checked
Having some multidimensional array problem in JSP
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 13:05:59.