spring mvc message converters xml download for windows 8.1 pro 32bit

toRus Blog

developer's affair

Spring: <mvc:message-converters> explained

Message converters are the powerful mechanism of transforming data into any of output response formats, like json, amf, hessian, etc.

Simple declaration of message converter in applicationContext.xml is

where SimpleMapper is sub-class of Jackson ObjectMapper

But what about other converters. What if we need to send other type of data with any other responses, not only json but amf or plain xml or any other content type? Should we fill list of messageConverters with all of the Converters implementations?

Here we have following code to help

With that default declaration AnnotationDrivenBeanDefinitionParser registers set of conversion services, validators and message-converters.

If no <message-converters> tag are defined in the <mvc:annotation-config> block then parser registers default set of message converters.

In case of <message-converters> has list of converter beans these converters replace default converters. If we want to include defaults in the chain of responses then we should point attribute register-defaults=”true” in the <message-converters> element.