• Post Reply Bookmark Topic Watch Topic
  • New Topic

Convert to EL

 
Gobind Singh
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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>
<%}%>
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65519
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The same way you would in Java, with a nested for loop, except in this case, it'd be nested <c:forEach> actions.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!