I want my restful server to support both json & xml data mapping - currently I am using the JacksonToJson Serializer for the json conversions - how would I define a xml serializer for the same data objects that are used in the json conversion?
my servelt.xml looks like this:
ThanksCode:<mvc:annotation-driven /> <bean class="org.springframework.web.servlet.view.ContentNegotiatingViewResolver"> <property name="mediaTypes"> <map> <entry key="json" value="application/json"/> </map> </property> <property name="viewResolvers"> <list> <bean class="org.springframework.web.servlet.view.BeanNameViewResolver"/> <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver"> <property name="viewClass" value="org.springframework.web.servlet.view.JstlView"> </property> <property name="prefix" value="/WEB-INF/jsp/"/> <property name="suffix" value=".jsp"/> </bean> </list> </property> </bean>


Reply With Quote