title: Get checked list from thymeleaf to controller
body: <p>I want to do something very simple. Check some projects from a view and save the checked projects.</p>
  
  <p>This is my view:</p>
  
  <pre><code> &lt;h1&gt;Projects&lt;/h1&gt;
              &lt;table class="table table-striped" id="myTable"&gt;
                  &lt;thead&gt;
                  &lt;tr&gt;
                      &lt;th&gt;Summary&lt;/th&gt;
                      &lt;th&gt;Check&lt;/th&gt;
                  &lt;/tr&gt;
                  &lt;/thead&gt;
                  &lt;tbody&gt;
                  &lt;tr th:each="p,iterationStatus : ${projects}"&gt;
                      &lt;td th:text="${p.summary}"&gt;&lt;/td&gt;
                      &lt;td&gt;&lt;input type="checkbox" th:value="${p}"/&gt;&lt;/td&gt;
                  &lt;/tr&gt;
                  &lt;/tbody&gt;
              &lt;/table&gt;
  </code></pre>
  
  <p>In the checkbox I put the Project object as the value.</p>
  
  <p>This is my partial controller method</p>
  
  <pre><code>@RequestMapping(method = RequestMethod.POST)
  public String saveChecked(@ModelAttribute("projects") Set&lt;Project&gt; projects){
      this.service.saveProjects(projects);
  
      return "home";
  }
  </code></pre>
  
  <p>How can I pass the selected projects to the saveChecked method when I click on a save button? I already searched for an answer, but sadly never found one.
  If  I understand it correctly @ModelAttribute("projects") will just return the whole list of projects and not only the selected ones.</p>