title: How to set end attribute dynamically with Struts2 iterator in JSP
body: <pre class="lang-jsp prettyprint-override"><code>&lt;% 
      RegisterAction aro=new RegisterAction();    
      int count=aro.getLi().size();
  %&gt;
  
  &lt;s:iterator value="li" begin="0" end="1"&gt;
      &lt;fieldset&gt;
          name     : &lt;s:property value="name"     /&gt;&lt;br/&gt;
          password : &lt;s:property value="password" /&gt;&lt;br/&gt;
          email    : &lt;s:property value="email"    /&gt;&lt;br/&gt;
          gender   : &lt;s:property value="gender"   /&gt;&lt;br/&gt;
          country  : &lt;s:property value="country"  /&gt;&lt;br/&gt;
      &lt;/fieldset&gt;
  &lt;/s:iterator&gt;
  </code></pre>
  
  <p>How to set <code>end</code> attribute value dynamically for iteration, reading the <code>count</code> variable ?</p>
  
  <p>If I use <code>end="&lt;%=count%&gt;"</code> this is not working.</p>
  
  <p>If I use <code>end="count"</code> it's working but I am getting same result multiple of numbers if I refresh the page or reload.</p>