title: Java spring post form one to many relationship
body: <p>I'm trying to get POST form data on controller of the object have one to many relationship. Like below code</p>
  
  <p>My Notification Model</p>
  
  <pre><code>private long id;
  @NotBlank(message = ERROR.NOT_EMPTY)
  private String title;
  @NotBlank(message = ERROR.NOT_EMPTY)
  private String content;
  // One Notification has many User
  private List&lt;NotificationUser&gt; listNotificationUser;;
  
  // Getter and setter method
  </code></pre>
  
  <p>My controller</p>
  
  <pre><code>@RequestMapping(value = "notification/add", method = RequestMethod.GET)
  public String create(ModelMap model) {
      ArrayList&lt;User&gt; listUser = userService.getAllUsername();
      model.put("user", listUser);
      model.addAttribute("notification", new Notification());
  
      return "notification/add";
  
  }
  @RequestMapping(value = "notification/add", method = RequestMethod.POST)
  public String create(ModelMap model, HttpServletRequest request,
          @Valid @ModelAttribute(value = "notification") Notification notification, BindingResult bindingResult) {
      ....
  }
  </code></pre>
  
  <p>My .jsp</p>
  
  <pre><code>&lt;form:form method="POST" action="add" name="addForm" commandName="notification"&gt;
          &lt;!-- Other input --&gt;
          &lt;form:select path="listNotificationUser" multiple="multiple" id="name" name="itemValue"&gt;
            &lt;form:options /&gt;
            &lt;form:options items="${user}" itemValue="id" itemLabel="name" /&gt;
          &lt;/form:select&gt;
        &lt;!-- Other input --&gt;
        &lt;/form:form&gt;
  </code></pre>
  
  <p>When I submit POST form to controller, the field notification.listNotificationUser always is null (other field is fine). </p>
  
  <p>I was search and try some solution but it not working.</p>