title: how to Auto Trim Strings of bean object in spring with Restful api?
body: <p>I want to trim all the form string fields trim automatically (trailing &amp; leading spaces only)</p>
  
  <p>Suppose if I pass FirstName = "  robert  "
  Expected: "robert"</p>
  
  <p>Controller class having following code : </p>
  
  <pre><code>@InitBinder
  public void initBinder ( WebDataBinder binder )
  {
      StringTrimmerEditor stringtrimmer = new StringTrimmerEditor(true);  
      binder.registerCustomEditor(String.class, stringtrimmer);
  }
  
  @RequestMapping(value = "/createuser", method = RequestMethod.POST)
  public Boolean createUser(@RequestBody  UserAddUpdateParam userAddUpdateParam) throws Exception {
  
      return userFacade.createUser(userAddUpdateParam);
  }  
  </code></pre>
  
  <p>when I debug the code, It's coming into @InitBinder but not trimming bean class string fields.  </p>