title: struts2 How read value iterator from jsp to action
body: <p>I'm new to java and struts2, please help.
  from an action I have read and process a list created in a jsp</p>
  
  <p><strong>my problem is, how do I have access to data from an action of an iterator?</strong></p>
  
  <p><strong>JSP PAGE</strong></p>
  
  <pre><code>&lt;s:iterator value="settoriList" var="myObj"&gt;
  &lt;tr&gt;
  &lt;td&gt;
     &lt;s:if test="#myObj.selected == 1"&gt;
        &lt;s:checkbox name="selected"   fieldValue="%{cdSettore}" checked="checked"/&gt;
        &lt;s:property value="cdSettore" /&gt;
     &lt;/s:if&gt;
     &lt;s:if test="#myObj.selected == 0"&gt;
        &lt;s:checkbox name="selected"  value="false" fieldValue="%{cdSettore}"  /&gt;
        &lt;s:property value="cdSettore" /&gt;
     &lt;/s:if&gt;
  &lt;/td&gt;
  &lt;td&gt;&lt;s:property value="dsSettore" /&gt;&lt;/td&gt;
  &lt;td&gt;&lt;s:property value="dtIniVali" /&gt;&lt;/td&gt;
  &lt;td&gt;&lt;s:property value="dtFineVali" /&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;/s:iterator&gt;
   &lt;/table&gt;
    &lt;s:hidden name="cdConve" /&gt;
    &lt;s:hidden name="process"   value="saveSettori"/&gt;
  &lt;/s:form&gt;
  </code></pre>
  
  <p><strong>Here is how I am trying to access the data</strong></p>
  
  <pre><code>private List&lt;GenSettori&gt; settoriList;
  
  public List&lt;GenSettori&gt; getSettoriList() {
      return settoriList;
  }
  public void setSettoriList(List&lt;GenSettori&gt; settoriList) {
      this.settoriList = settoriList;
  }
  
  private String[] selected;
  
  public String[] getSelected() {
      return selected;
  }
  public void setSelected(String[] selected) {
      this.selected = selected;
  }
  
  --------
     settoriList = new ArrayList&lt;GenSettori&gt;();
     System.out.println("list sett: "+settoriList);
      for(int i=0;i&lt;getSettoriList().size();i++){
       if (getSelected()[i]!=""){
           System.out.println("not selected "+getSelected()[i]);
    }      
     }
  
  ---------
  </code></pre>
  
  <p>My page is formed by selected field, a description and a date.</p>
  
  <p><strong>Thanks in advance for any help</strong></p>