title: Spring MVC passing ArrayList back to controller
body: <p>I am new to Spring. I display a list with users. Every row has a checkbox for removing the users.</p>
  
  <p>Controller:</p>
  
  <pre><code>@Controller
  public class AdminController {
  
      @Autowired
      private UserDao userDao;
  
      @RequestMapping(value = "/admin", method = RequestMethod.GET)
      public ModelAndView adminPage() {
          ModelAndView model = new ModelAndView();
          model.addObject("users", userDao.findAll());
          model.setViewName("admin");
          return model;
  
      }
  
      @RequestMapping(value = "admin/remove", method = RequestMethod.POST)
      public ModelAndView removeUser(@ModelAttribute(value = "users") ArrayList&lt;User&gt; users) {
          ModelAndView model = new ModelAndView();
          //UPDATE USERS HERE 
          model.setViewName("redirect:/admin");
          return model;
  
      }
  </code></pre>
  
  <p>JSP:</p>
  
  <pre><code>&lt;form:form action="/admin/remove" method="POST"  modelAttribute="users"&gt;
              &lt;table class="table table-striped"&gt;
                  &lt;thead&gt;
                      &lt;tr&gt;
                          &lt;th&gt;Firstname&lt;/th&gt;
                          &lt;th&gt;Lastname&lt;/th&gt;
                          &lt;th&gt;Email/login&lt;/th&gt;
                          &lt;th&gt;Profession&lt;/th&gt;
                          &lt;th&gt;Select&lt;th&gt;
                      &lt;/tr&gt;
                  &lt;/thead&gt;
                  &lt;tbody&gt;
                      &lt;c:forEach var="user" items="${users}"&gt;
                          &lt;tr&gt;
                              &lt;td&gt;${user.firstName}&lt;/td&gt;
                              &lt;td&gt;${user.lastName}&lt;/td&gt;
                              &lt;td&gt;${user.login}&lt;/td&gt;
                              &lt;td&gt;${user.profession}&lt;/td&gt;
                              &lt;td&gt;&lt;input type="checkbox" value="${user.delete}"/&gt;&lt;/td&gt;
                          &lt;/tr&gt;
                      &lt;/c:forEach&gt;
                  &lt;/tbody&gt;
              &lt;/table&gt;            
              &lt;input type="submit" value="Delete user(s)" class="btn-danger" /&gt;
              &lt;input type="hidden" name="${_csrf.parameterName}" value="${_csrf.token}" /&gt;
              &lt;/form:form&gt;
  </code></pre>
  
  <p>The list is rendered correctly. If i press the "Delete user(s)" button. The @modelAttribute users is empty.
  I also tried wrapping the list in a new class, but i get the same results.</p>
  
  <p>Any ideas?</p>