title: Spring. Binding checkboxes to ModelAttribute
body: <p>Unable to bind checkboxes to @ModelAttribute.</p>
  
  <p>HTML:</p>
  
  <pre><code>&lt;form method="post"&gt;
      &lt;p&gt;&lt;input type="checkbox" name="list" value="v1" /&gt;&lt;/p&gt;
      &lt;p&gt;&lt;input type="checkbox" name="list" value="v2" /&gt;&lt;/p&gt;
      &lt;p&gt;&lt;input type="checkbox" name="list" value="v3" /&gt;&lt;/p&gt;
      &lt;p&gt;&lt;input type="checkbox" name="list" value="v4" /&gt;&lt;/p&gt;
      &lt;p&gt;&lt;input type="submit" value="Send" /&gt;&lt;/p&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>Java:</p>
  
  <pre><code>@RequestMapping(value = "/", method = RequestMethod.POST)
  public String index(@ModelAttribute("list")List&lt;String&gt; list, ModelMap model)
  {
      LoggerFactory.getLogger(this.getClass()).debug("list: " + list.size() + " " + list);
      ...
  }
  </code></pre>
  
  <p>Checked v2 and v3. In "index" first value only:</p>
  
  <p>list: 1 [v2]</p>
  
  <p>If I create form with spring tag:</p>
  
  <pre><code>&lt;form:form modelAttribute="testForm"&gt;
      &lt;p&gt;&lt;form:checkbox path="list" value="v1" /&gt;&lt;/p&gt;
      &lt;p&gt;&lt;form:checkbox path="list" value="v2" /&gt;&lt;/p&gt;
      &lt;p&gt;&lt;form:checkbox path="list" value="v3" /&gt;&lt;/p&gt;
      &lt;p&gt;&lt;form:checkbox path="list" value="v4" /&gt;&lt;/p&gt;
      &lt;p&gt;&lt;input type="submit" value="Отправить" /&gt;&lt;/p&gt;
  &lt;/form:form&gt;
  </code></pre>
  
  <p>TestForm.java:</p>
  
  <pre><code>public class TestForm
  {
      private String[] list;
  
      public String[] getList()
      {
          return list;
      }
  
      public void setList(String[] list)
      {
          this.list = list;
      }
  }
  </code></pre>
  
  <p>Everything is ok!</p>
  
  <p>How to bind checkbox to @ModelAttribute without spring tag?</p>