title: How to display pre-checked checkboxes inside iterator in Struts 2
body: <p>I need to iterate through <code>List&lt;String&gt;</code>, each element has <code>s:checkbox</code>. </p>
  
  <p>I have defined one list in Action layer to keep selected elements. </p>
  
  <p>Using my code I can submit my form and capture selected values in action layer. But,   some of the checkboxes must be pre-checked. I cannot display pre- checked status when loading the page.</p>
  
  <p><code>Value1</code> contains list of String objects. </p>
  
  <p><code>functionCheckBoxList</code> -  The list I have defined to keep checked element</p>
  
  <p>While loading, I added some element to <code>functionCheckBoxList</code> that belongs to <code>Value1</code>. </p>
  
  <p>But still does not show pre-checked status in the page.</p>
  
  <pre><code>&lt;s:iterator value="value1" var ="functionName"&gt;
          &lt;s:checkbox  fieldValue="%{#functionName}" name="functionCheckBoxList" 
              value="%{#functionName}"  theme="simple" &gt;
           &lt;/s:checkbox&gt;
  &lt;/s:iterator&gt;
  </code></pre>
  
  <p>Note: I know how to do it using <code>s:checkboxlist</code> but can't here as I need special format in the iteration.</p>