-
Feb 5th, 2013, 10:55 AM
#1
Manually configure the JSON serialization Mapper for a REST service
Hi,
We have a web service delivering JSON and want to include now a library which depends on fasterXml's Jackson. But we want to use codehouse's Jackson as we did before as there is a difference how the JodaTime objects are serialized and we know that the clients are using an older spring version with the same Jackson.
How to I tell spring, in our context xml file, to use the codehouse ObjectMapper for Json Serialization?
Thanks and Regards
Paul.
-
Mar 12th, 2013, 01:53 AM
#2
I managed it with this configuration (in the correct context file...):
<bean id="jacksonObjectMapper" class="org.codehaus.jackson.map.ObjectMapper" />
<mvc:annotation-driven>
<mvc:message-converters register-defaults="true">
<bean id="jacksonMessageConverter"
class="org.springframework.http.converter.json.Map pingJacksonHttpMessageConverter">
<property name="objectMapper" ref="jacksonObjectMapper" />
</bean>
</mvc:message-converters>
</mvc:annotation-driven>
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules