Working with CXF-RS if you want to generate the json response along with xml than it becomes pain in cases where your xml is a mixture of attributes and elements. Problem comes because of default jettison json provider which is configured in cxf-rs. The jettison appends the '@' prefix with the attributes. However, I needed json free from any prefixes. To achieve this i had configure jackson as json provider like this:
<jaxrs:providers>
<ref bean="jaxbProvider" />
<ref class="org.codehaus.jackson.jaxrs.JacksonJsonProvider"/>
</jaxrs:providers>
That's it and you should be free from prefixes.
<jaxrs:providers>
<ref bean="jaxbProvider" />
<ref class="org.codehaus.jackson.jaxrs.JacksonJsonProvider"/>
</jaxrs:providers>
That's it and you should be free from prefixes.
Comments
Post a Comment