I have the same question as in the above link but with Struts2, when I put the code within as below it does not work.
<s:form>
<%!int i, j;%>
<%
for (i = 0; i < 5; i++) {
%>
<%
for (j = 0; j < 5; j++) {
%>
<div class="One" id="j<%=j%>">
Hey<%=i%></div>
<%
}
%>
<%
}
%>
</s:form>
I know this is not good to use scriptlet, but atleast it should work.