title: How to run s:iterator for a fixed number of times in struts2
body: <p>I have a iterator in my struts 2 code as follows:</p>
  
  <pre><code>&lt;s:iterator var="each_part" value="#request.rule.parts" status="eachpart"&gt;
  </code></pre>
  
  <p>Now, 'rule' is a POJO which is set into request in Struts2 action class. And 'parts' is an Arraylist of POJOs.</p>
  
  <p>Now at runtime, there are 7 POJOs stored in arraylist 'parts', so iterator runs for 7 times.</p>
  
  <p>Inside iterator tag , I'm creating a html table. So 7 tables are shown on jsp. </p>
  
  <p>Now my requirement is to show 20 maximum tables, out of which 7 will be filled at runtime and other will be empty. But in my case, since iterator runs only for 7 times, only 7 tables are shown on jsp page. </p>
  
  <p>Is there any way that the iterator runs for 20 times and picks property for first 7 times from arraylist and for remaining 13 times, it displays blank tables?</p>
  
  <p>I tried this</p>
  
  <pre><code>&lt;s:iterator var="each_part" value="(20).{#request.rule.parts}" status="eachpart"&gt;
  </code></pre>
  
  <p>but it didn't worked.</p>
  
  <p>Please assist me on this.</p>