-
Notifications
You must be signed in to change notification settings - Fork 38.7k
Description
Kenneth DeLong opened SPR-7504 and commented
See https://support.springsource.com/spring_support_client_getIncidentById/9995
I needed to use MarshallingHttpMessageConverter (so @RequestBody
could bind a POST of XML to a POJO). AnnotationMethodHandlerAdapter is preconfigured in its constructor with several MessagConverters, but not MarshallingHttpMessageConverter. Using the mvc:annotation-config/ tag, it was nearly impossible to add this MessageConverter to the AMHA. Per Spring Support, I had to write a BeanPostProcessor to look for the AMHA and then add the MTHC (and to add insult to injury, it was an array!).
There should be a simpler way to add MessageConverters; in fact, if they are found in the application context they should be added automatically, or they should be added via the mvc:annotation-config. Or anything more elegant than the BeanPostProcessor.
Also section 19.9 of the reference document implies that MarshallingHttpMessageConverter is configured by default, but it's not.
Affects: 3.0.4
Reference URL: https://support.springsource.com/spring_support_client_getIncidentById/9995
Attachments:
- 7504.patch (3.35 kB)
Issue Links:
- Setting default charset in StringHttpMessageConverter [SPR-7904] #12559 Setting default charset in StringHttpMessageConverter
- AnnotationDrivenBeanDefinitionParser should allow injection of custom HttpMessageConverter's [SPR-7091] #11751 AnnotationDrivenBeanDefinitionParser should allow injection of custom HttpMessageConverter's
- <mvc:annotation-driven / > should supports the attributes of setting customized HttpMessageConverter bean list [SPR-7191] #11851 <mvc:annotation-driven / > should supports the attributes of setting customized HttpMessageConverter bean list
0 votes, 6 watchers