title: Spring MVC form:select Tag, multiple selections not binding correctly?
body: <p>I am trying to create a form to edit an existing database row. I am using the Spring MVC form tag to auto bind the html to a form backing object. The row has a many to many relationship with another table, which I am trying to represent with a multiple select box using the form:select tag;</p>
  
  <pre><code>&lt;form:select path="rules"&gt;
      &lt;form:options items="${bundle.rules}" itemValue="name" itemLabel="name"/&gt;
  &lt;/form:select&gt;
  </code></pre>
  
  <p>I am using Hibernate for persistence so the relationship is represent as a HashSet inside the Bundle pojo.</p>
  
  <pre><code> private Set&lt;Rule&gt; rules = new HashSet&lt;Rule&gt;(0);
  </code></pre>
  
  <p>Without the selection box on the page, the object will update to the database correctly, however with the selection box the object will not update to the database and I am getting this error in my log4j log, note that this error is not causing an exception, it is only visible in the logs;</p>
  
  <pre><code>DEBUG org.springframework.web.servlet.mvc.SimpleFormController.processFormSubmission(SimpleFormController.java:256) - Data binding errors: 1
  </code></pre>
  
  <p>This happens regardless of wither I deselect items inside the select box, the entire form refuses to submit correctly. Can anyone help me?</p>
  
  <p>I am aware of <a href="https://stackoverflow.com/questions/284368/how-do-i-bind-collection-attributes-to-a-form-in-spring-mvc">How do I bind collection attributes to a form in Spring MVC</a>, which is similar to this question, unfortunately none of the suggestions seemed useful to my problem.</p>