title: Spring webFlow bind a list of objects with checkboxes
body: <p>I'm trying to create a list of checkboxes for a list of objects.
  In my form backing bean I have 2 lists. One list with the reference data that contains all my organizations. Another list that will contain the selected organizations.</p>
  
  <p>My page loads fine but when I try to submit it I get the following exception:</p>
  
  <pre><code> Caused by: javax.servlet.ServletException: javax.servlet.jsp.JspTagException: No message found under code 'typeMismatch on selectedOrganizations' for locale 'nl'.
      at org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:852)
      at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:781)
      at org.apache.jsp.WEB_002dINF.views.flows.validation_jsp._jspService(validation_jsp.java:177)
      at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
      at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:369)
      at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:322)
      at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:249)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:638)
      at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:543)
      at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:480)
      at org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:968)
      at org.apache.jsp.tag.web.wizard_tag._jspx_meth_form_005fform_005f0(wizard_tag.java:198)
      at org.apache.jsp.tag.web.wizard_tag.doTag(wizard_tag.java:146)
      at org.apache.jsp.WEB_002dINF.views.management.roleinvitation.create.selectOrganizations_jsp._jspx_meth_iam_005fwizard_005f0(selectOrganizations_jsp.java:375)
      at org.apache.jsp.WEB_002dINF.views.management.roleinvitation.create.selectOrganizations_jsp._jspService(selectOrganizations_jsp.java:141)
      ... 126 more
  </code></pre>
  
  <p>Find my code snippets here:</p>
  
  <p><strong>JSP</strong></p>
  
  <pre><code>&lt;c:forEach items="${organizations}" var="${organization}"&gt;
    &lt;form:checkbox cssClass="organizationCheckbox" path="selectedOrganizations" value="${organization}"/&gt;
  &lt;/c:forEach&gt;
  </code></pre>
  
  <p><strong>View Model</strong></p>
  
  <pre><code>public class CreateRoleInvitationViewModel implements Serializable {
    private List&lt;OrganizationViewModel&gt; selectedOrganizations;
    private List&lt;OrganizationViewModel&gt; organizations;
  ...
  }
  </code></pre>
  
  <p><strong>Converter</strong></p>
  
  <pre><code>public class StringToOrganizationViewModel extends StringToObject {
  
    public StringToOrganizationViewModel() {
      super(OrganizationViewModel.class);
    }
  
    @Override
    protected Object toObject(String code, Class targetClass) throws Exception {
      OrganizationViewModel orgViewModel = new OrganizationViewModel();
      orgViewModel.setCode(code);
      return orgViewModel;
    }
  
    @Override
    protected String toString(Object object) throws Exception {
      return ((OrganizationViewModel)object).getCode();
    }
  
  }
  </code></pre>
  
  <p>I've checked if the converter is used and it is used. I pass the toString(Object object) method when my page gets loaded.
  When I try to submit I don't pass the toObject(String code, Object objectClass) because the exception occurs before it.</p>
  
  <p><strong>Note</strong>: When I only select one checkbox..everything works fine. I can see that my backing bean contains a selectedOrganisations list with one entry. When I select multiple checkboxes than it crashes....</p>