title: Handling JSON and form data request with Spring MVC
body: <p>I'm working on simple Spring-MVC application and I love new Spring REST features. I'd like to use the same method to process regular form and JSON data. It seems to be a little tricky, however. For example, method</p>
  
  <pre>
  public @ResponseBody String process(@RequestBody Bean bean);
  </pre>
  
  <p>will work for JSON request (Content-type: application/json), and</p>
  
  <pre>
  public @ResponseBody String process(Bean bean);
  </pre>
  
  <p>will match request with Content-type: application/x-www-form-urlencoded.</p>
  
  <p>These methods are obviously will have almost the same content, so I'd prefer to avoid such duplication. With Jersey it's possible with <code>@Consumes</code> annotations, but I can't figure out how to do it with Spring.</p>