I'm working on JSPs with Struts2, I have to iterate on two lists, and change the background code of each <tr/>
printed.
My JSP snippet:
<s:set var="counter" value="0" scope="page" />
<s:iterator value="listaContoCapitale" status="i">
<s:iterator value="utilizzi" status="j">
<s:if test="#counter == 0 || #counter % 2 == 0">
<s:set var="trclass" value="'rigaSfondo1'" scope="page" />
</s:if>
<s:else>
<s:set var="trclass" value="''" scope="page" />
</s:else>
<tr class="${trclass}">
....tds
</tr>
</s:iterator>
<s:set var="counter" value="here i have to change its value (increment it by1)" />
</s:iterator>
I need to increment my counter every step on the inner loop. Is there a way to increment my counter value by a simple struts tag? I know I could use Java scriptlet but I rather keep the JSP clear if possible.