title: How to send list of Objects to View and back to Post method in controller
body: <p>Suppose I have class <code>Person</code>, I made a list of <code>Person</code> instances and add this list to a <code>Model</code>.</p>
  
  <pre><code>List&lt;Person&gt; persons = new ArrayList&lt;Person&gt;();
  model.addAttribute("persons",persons);
  return "savePersons";
  </code></pre>
  
  <p>In the <code>View</code> page I have a form:</p>
  
  <pre><code>&lt;form:form method="post" action="savePerson" modelAttribute="persons"&gt;
      &lt;c:forEach var="person" items="${persons}"&gt;
          &lt;form:input path="person.FName" name="FName" id="FName" value="" /&gt;
          &lt;form:input path="person.LName" name="LName" id="LName" value="" /&gt;
      &lt;/c:forEach&gt;
  
      &lt;button type="submit"&gt;&lt;/button&gt;
  &lt;/form:form&gt;
  </code></pre>
  
  <p>When I click on the submit button I want to bind the <code>Person List</code> to the POST method on the controller..</p>
  
  <pre><code>@RequestMapping(value = { "savePerson" }, method = RequestMethod.POST)
  public String savePerson(Model model, HttpServletRequest request,
          HttpSession session,@ModelAttribute("persons")List&lt;Person&gt; persons) {
      System.out.println(persons.length);
      return "success";
  }
  </code></pre>
  
  <p>but the <code>persons</code> list is not binding/fetching at the <code>POST</code> method.</p>
  
  <p>Is it possible to bind a list objects in this way or is there an alternative for this?</p>