title: @ModelAttribute for Rest PUT - request param null
body: <p>I need to populate my pojo class based on the request param 'type'.
  so I have code like</p>
  
  <pre><code>@ModelAttribute
  public void getModelObject(HttpServletRequest request, ModelMap modelMap) {
      String typeCombo = request.getParameter("type");
      System.out.println("typeCombo: " + typeCombo);
      if (typeCombo != null) {
          if (condition) {
              modelMap.addAttribute("modelObj", new ClassB()); //ClassB extends ClassA
          } else if (another condition) {
              modelMap.addAttribute("modelObj", new ClassC()); //ClassC extends ClassA
          } else {
              System.out.println("no type found");
          }
      } else {
          System.out.println("typecombo null");
      }
  
  }
  </code></pre>
  
  <p>I use above method to get create correct subclasses which will be used to add / update. The above one works fine in case of "POST" - for creating a record. But for "PUT" request.getParameter("type") always returns null. So for editing, I'm not able to get correct subclasses.</p>
  
  <p>Below are my post and put request mapping:</p>
  
  <pre><code>@RequestMapping(value = "", method = RequestMethod.POST, headers = "Accept=*/*")
  @ResponseBody
  public String addCredentials(@ModelAttribute("modelObj") Credential credential,
                               ModelMap modelMap) {
  //code
  }
  
  
  @RequestMapping(value = "/edit/{id}", method = RequestMethod.PUT, headers = "Accept=*/*")
  @ResponseBody
  public Credential editCredential(@ModelAttribute ("modelObj") Credential credential, @PathVariable long id, ModelMap model) {
  </code></pre>
  
  <p>//code
  }</p>
  
  <p>Any help is much appreciated. </p>