title: Struts2 increment a previous set <s:set /> value
body: <p>I'm working on JSPs with Struts2, I have to iterate on two lists, and change the background code of each <code>&lt;tr/&gt;</code> printed. </p>
  
  <p><strong>My JSP snippet:</strong></p>
  
  <pre><code>&lt;s:set var="counter" value="0" scope="page" /&gt;
  &lt;s:iterator value="listaContoCapitale" status="i"&gt;
      &lt;s:iterator value="utilizzi" status="j"&gt;
  
      &lt;s:if test="#counter == 0 || #counter % 2 == 0"&gt;
          &lt;s:set var="trclass" value="'rigaSfondo1'" scope="page" /&gt;
      &lt;/s:if&gt;
      &lt;s:else&gt;
          &lt;s:set var="trclass" value="''" scope="page" /&gt;
      &lt;/s:else&gt; 
      &lt;tr class="${trclass}"&gt;
          ....tds
      &lt;/tr&gt;
      &lt;/s:iterator&gt;
      &lt;s:set var="counter" value="here i have to change its value (increment it by1)" /&gt;
  &lt;/s:iterator&gt;
  </code></pre>
  
  <p>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.</p>