title: Submitting forms as a Collection Using the <logic:iterate> tag in Struts1.3
body: <p>Using Struts 1.3.</p>
  
  <p>Submitting forms as a collection using the <code>&lt;logic:iterate&gt;</code> tag I'd like to format multiple records of user to edit values.</p>
  
  <p>When the data is submitted back to the <code>Action</code> how can it handle a list of form in an Action form? Is there a way to submit the results as a collection of forms?</p>
  
  <p>For example, I have <code>List&lt;EmployeeForm&gt;</code> and I am iterating these records on my jsp page and it's working fine. But the records are editable on the JSP page, so after modifying the records and pressing the submit button I need the <code>List&lt;EmployeeForm&gt;</code> with updated records inside my action class to update the records inside the DB.</p>
  
  <p>update, my jsp page is below given:</p>
  
  <pre><code>&lt;html:form action="modify.do" styleId="LogicIterateForm" method="post"&gt;
              &lt;table style="font-weight:bold"&gt;
              &lt;tr&gt;&lt;td&gt;Employee ID&lt;/td&gt;&lt;td&gt;Employee Name&lt;/td&gt;&lt;/tr&gt;
              &lt;logic:iterate id="employee" name="LogicIterateForm" property="emp" indexId="i"&gt;
  
             &lt;tr&gt;
  </code></pre>
  
  <p><code>enter code here</code>
                    
                 
      </p>
  
  <pre><code>           &lt;/tr&gt;
          &lt;/logic:iterate&gt;
  &lt;tr&gt;
      &lt;html:submit onclick="submitForm()"&gt;Modify&lt;/html:submit&gt;
  &lt;/tr&gt;
      &lt;/table&gt;
          &lt;/html:form&gt;
  </code></pre>
  
  <p>action: to perform on clicking of  <code>Modify</code> button</p>
  
  <pre><code>LogicIterateForm logicIterateForm=(LogicIterateForm)form;
          List&lt;Employee&gt; empList=logicIterateForm.getEmp();
          System.out.println("Size of emp:::::"+empList.size());
          if(empList!=null &amp;&amp; empList.size()&gt;0)
          {
              for(Employee emp:empList)
              {
                  if(emp!=null)
                  {
                      System.out.println("EmployeeID:::::::::::"+emp.getEmpId());
                      System.out.println("EmployeeName:::::::::::"+emp.getEmpName());
                  }
              }
          }
  </code></pre>
  
  <p>and it is working fine to send the list of employees inside the action but unfortunately i am unable to get the updated form fields value inside my action. please help me where i am doing mistake. </p>
  
  <p>and below is my ActionForm</p>
  
  <pre><code>public class LogicIterateForm extends org.apache.struts.action.ActionForm {
  
  
      private List&lt;Employee&gt; emp=new ArrayList&lt;Employee&gt;();
  
  
      public List&lt;Employee&gt; getEmp() {
          return emp;
      }
  
      public void setEmp(List&lt;Employee&gt; emp) {
          this.emp = emp;
      }
  </code></pre>
  
  <p>and Employee class is a plan java class with <code>setter and getter of empId and empName</code></p>