title: @RequestParam custom object
body: <p>I use Spring MVC 3.1 in my app. Say I have a methods in controller as follows:</p>
  
  <pre><code>@RequestMapping(value = "/assignUser", method = RequestMethod.GET)
  public String assignUserToCompany(ModelMap map){
      List&lt;CompanyDetails&gt; companies = //companies list from DAO
      List&lt;UserDetails&gt; users = //users list from DAO
      map.addAttribute("companiesList",companies);
      map.addAttribute("usersList",users);
      return "someView";
  }
  
  @RequestMapping(value = "/assignUser", method = RequestMethod.POST)
      public String assignUserToCompany(@RequestParam("user")UserDetails user,
                                        @RequestParam("company")CompanyDetails company){
  
      if(user!=null &amp;&amp; company!=null){
        // some operations with entities
      }
  
      return "someView";
      }
  </code></pre>
  
  <p>and I have a form on the view side:</p>
  
  <pre><code>&lt;form method="post" action="assignUser.html"&gt;
          &lt;label for="select-users"&gt;&lt;spring:message code="assignUser.label.users"/&gt; &lt;/label&gt;
          &lt;select id="select-users" name="user"&gt;
              &lt;c:forEach items="${usersList}" var="user"&gt;
                  &lt;option value="${user}"&gt;${user.firstName} ${user.legalName}&lt;/option&gt;
              &lt;/c:forEach&gt;
          &lt;/select&gt;
          &lt;label for="select-companies"&gt;&lt;spring:message code="assignUser.label.companies"/&gt; &lt;/label&gt;
          &lt;select id="select-companies" name="company"&gt;
              &lt;c:forEach items="${companiesList}" var="company"&gt;
                  &lt;option value="${company}"&gt;${company.name}&lt;/option&gt;
              &lt;/c:forEach&gt;
          &lt;/select&gt;
          &lt;input type="submit" value="&lt;spring:message code="assignUser.label.submit"/&gt;"/&gt;
      &lt;/form&gt;
  </code></pre>
  
  <p>I want to pass object I select in input as request parameters and perform some operations with them but standart @RequestParam permit me only primitive types and wrappers as we know.
  Can I customize this in order to pass my objects? Thank you.</p>