title: get values entered on jsp to action class
body: <p>How Can I get the value when I type something new into the jsp and then submit the list to the actionclass? Currently I am able to submit to the action class from the jsp and see the new list that I create inside my action. But I would like to be able to retirieve the values that I type into the jsp. </p>
  
  <p>Employee object class: </p>
  
  <pre><code>public class Employee {
      String empid;
      String empname;
  
          public String getEmpid() {
              return empid;
          }
  
          public void setEmpid(String empid) {
              this.empid = empid;
          }
  
          public String getEmpname() {
              return empname;
          }
  
          public void setEmpname(String empname) {
              this.empname = empname;
          }
  
          public Employee(String empid, String empname) {
              this.empid = empid;
              this.empname = empname;
          }
  
  
  
      } 
  </code></pre>
  
  <p>Employee JSP: </p>
  
  <pre><code>&lt;%@page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-    8859-1"%&gt;
      &lt;%@ include file="../imports.jsp" %&gt;  
       @page import="java.util.List"%&gt;
  &lt;html&gt;
  &lt;head&gt;
      &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8"&gt;
      &lt;title&gt; Struts Logic Iterate Tag&lt;/title&gt;
  &lt;/head&gt;
  &lt;body bgcolor="#ffcc66"&gt;
  &lt;html:form action="/logiciterate" styleId="LogicIterateForm" method="post"&gt; 
  
      &lt;h1&gt;Struts logic:iterate tag &lt;/h1&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 name="LogicIterateForm" property="emp" id="employee"&gt;
              &lt;tr&gt;
                      &lt;td&gt;&lt;html:text name="employee" value="${employee.empid}"          property="empid"
                              indexed="true" /&gt;&lt;/td&gt;
                      &lt;td&gt;&lt;html:text name="employee" value="${employee.empname}"
                              property="empname" indexed="true" /&gt;&lt;/td&gt;
              &lt;/tr&gt;
      &lt;/logic:iterate&gt;
  </code></pre>
  
  <p></p>
  
  <pre><code>            &lt;input type="submit"  id="submit" value="Submit"   title="Submit" name="Submit"   &gt;
  </code></pre>
  
  <p></p>
  
  <pre><code>            &lt;/html:form&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p></p>
  
  <p>Action Class: </p>
  
  <pre><code>    public class LogicIterateAction extends org.apache.struts.action.Action {
  
  private final static String SUCCESS = "success";
  
  
  public ActionForward execute(ActionMapping mapping, ActionForm form,
          HttpServletRequest request, HttpServletResponse response)
          throws Exception {
  
     if(request.getParameter("Submit") == null) {          
  
                                  LogicIterateForm formBean=(LogicIterateForm)form;
                                 ArrayList&lt;Employee&gt; list = new ArrayList&lt;Employee&gt;();
                                  list.add(new Employee("11A0","Jack"));
                                  list.add(new Employee("11A1","Sam"));
                                  list.add(new Employee("11A2","Joe"));
                                  list.add(new Employee("11A3","John"));
                                  formBean.setEmp(list);
                                      return mapping.findForward(SUCCESS);
  
  }
  
  
  
  else{
  
       LogicIterateForm formBean=(LogicIterateForm)form;
        ArrayList&lt;Employee&gt; list2 = new ArrayList&lt;Employee&gt;();
                  list2.add(new Employee("673","Queenie"));
                  list2.add(new Employee("123","Wally"));
                  list2.add(new Employee("345","Spike"));
                  list2.add(new Employee("564","Red"));
                  formBean.setEmp(list2);
  
  
  
       return mapping.findForward(SUCCESS);
  
  }
  
  
  }
  }
  </code></pre>