Description
Keith Donald opened SPR-6729 and commented
I noticed this when using @RequestBody
on an Account JavaBean @Controller
parameter, when the ContentType of my POST /accounts request was "application/x-www-form-urlencoded". In this case, the resolved FormHttpMessageConverter is only capable of reading a MultiValueMap, not an Account, so I get a 415 back due to a HttpMediaTypeNotSupportedException. However, the ConversionService configured with Spring MVC may be capable of mapping a MultiValueMap to a JavaBean, but it is never queried inside resolveRequestBody of AnnotationMethodHandlerAdapter. If the ConversionService is capable of such a mapping, should it be invoked to allow the Account binding to succeed? Or should it be the sole responsibility of the MessageConverter to determine if binding is possible?
Affects: 3.0 GA
Issue Links:
- Clarify use of "x-www-form-urlencoded" in reference documentation [SPR-8415] #13063 Clarify use of "x-www-form-urlencoded" in reference documentation
- MappingJacksonHttpMessageConverter's ObjectMapper does not use ConversionService when binding JSON to JavaBean properties [SPR-6731] #11397 MappingJacksonHttpMessageConverter's ObjectMapper does not use ConversionService when binding JSON to JavaBean properties
1 votes, 1 watchers