title: Http Post with request content type form not working in Spring MVC 3
body: <p>code snippet: </p>
  
  <pre><code>@RequestMapping(method = RequestMethod.POST)//,  headers = "content-type=application/x-www-form-urlencoded")
  public ModelAndView create(@RequestBody UserAccountBean account) {
      try{
          accounts.put(account.assignId(), account);
      }catch(RuntimeException ex)
      {
          return new ModelAndView("account/registerError");
      }
      return new ModelAndView("account/userVerification");
  }
  </code></pre>
  
  <p>After receiving request, What I got is Http Status code 415:
  The server refused this request because the request entity is in a format not supported by the requested resource for the requested method ().</p>
  
  <p>If I change the code to this:</p>
  
  <p>code snippet: </p>
  
  <pre><code>@RequestMapping(method = RequestMethod.POST,headers = "content-type=application/x-www-form-urlencoded")
  public ModelAndView create(@RequestBody UserAccountBean account) {
      try{
          accounts.put(account.assignId(), account);
      }catch(RuntimeException ex)
      {
          return new ModelAndView("account/registerError");
      }
      return new ModelAndView("account/userVerification");
  }
  </code></pre>
  
  <p>I will get  405 Method not allowed. Funny thing is in the allow header of response, it lists GET and POST as allowed methods. </p>
  
  <p>I do have a class that does JOSN mapping:</p>
  
  <pre><code>@Component
  public class JacksonConversionServiceConfigurer implements BeanPostProcessor {
  
  private final ConversionService conversionService;
  
  @Autowired
  public JacksonConversionServiceConfigurer(ConversionService conversionService) {
      this.conversionService = conversionService;
  }
  
  public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException {
      return bean;
  }
  
  public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
      if (bean instanceof AnnotationMethodHandlerAdapter) {
          AnnotationMethodHandlerAdapter adapter = (AnnotationMethodHandlerAdapter) bean;
          HttpMessageConverter&lt;?&gt;[] converters = adapter.getMessageConverters();
          for (HttpMessageConverter&lt;?&gt; converter : converters) {
              if (converter instanceof MappingJacksonHttpMessageConverter) {
                  MappingJacksonHttpMessageConverter jsonConverter = (MappingJacksonHttpMessageConverter) converter;
                  jsonConverter.setObjectMapper(new ConversionServiceAwareObjectMapper(this.conversionService));
              }               
          }
      }
      return bean;
  }
  
  }
  </code></pre>
  
  <p>Copied from Spring examples. works great with JSON content-type. </p>
  
  <p>A more general question is how to make spring mvc request handlers work with different request content-types. 
  Any advice would be greatly appreciated. </p>