title: Empty form when submitting with SpringMVC and Thymeleaf
body: <p>I'm trying to edit data (checkboxes) in a table. But when I click on the submit button, the form in the controller is empty</p>
  
  <p>I didn't find a example with thymeleaf so I adapted <a href="http://viralpatel.net/blogs/spring-mvc-multi-row-submit-java-list" rel="nofollow noreferrer">this example</a></p>
  
  <p>I use a form object: </p>
  
  <pre><code>public class MyForm {
    private List&lt;MyObj&gt; data;
    // ...
  }
  </code></pre>
  
  <p>The controller with the two methods (GET and POST):</p>
  
  <pre><code>@RequestMapping(value="/edit/", method = RequestMethod.GET)
  public String editGet(Model model) {
    MyForm form = new MyForm(data);
    model.addAttribute("myForm", form);
    return "editPage";
  }
  
  @RequestMapping(value="/edit/save", method = RequestMethod.POST)
  public String editPost(@ModelAttribute("myForm") MyForm myForm, Model model) {
   // here myForm.getData() is empty
  }
  </code></pre>
  
  <p>And my html:</p>
  
  <pre><code>&lt;form th:action="@{/edit/save}" th:object="${myForm}" method="POST"&gt;
    &lt;table&gt;
      &lt;thead&gt;....&lt;/thead&gt;
        &lt;tbody th:each="myObj : *{data}" th:remove="tag"&gt;
          &lt;tr&gt;
            &lt;td&gt;&lt;span th:text="${myObj.name}"&gt;&lt;/span&gt;&lt;/td&gt;
            &lt;td&gt;&lt;input type="checkbox" th:checked="${myObj.isOK}"/&gt;&lt;/td&gt;
          &lt;/tr&gt;
        &lt;/tbody&gt;
    &lt;/table&gt;
    &lt;input type="submit"&gt;Save&lt;/input&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>What did I forget?</p>