had a similar situation. cxf does not return the array of arrays requested by js, it adds an additional tag "item" additionally. When changing to applicationContext.xml add jsonProvider and send it to jaxrs.
<jaxrs:server id="someid" address="/"> <jaxrs:providers> <ref bean="jsonProvider" /> </jaxrs:providers> <bean id="jsonProvider" lass="com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider"> <property name="mapper" ref="jsonMapper" /> </bean> <bean id="jsonMapper" class="com.bofa.idp.disclosures.CustomJsonMapper" />
...
in customJsonMapper extends ObjectMpper and can perform customization
public CustomJsonMapper() { super(); enable(DeserializationFeature.UNWRAP_ROOT_VALUE); enable(SerializationFeature.WRAP_ROOT_VALUE); enable(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY); JaxbAnnotationModule jaxbModule=new JaxbAnnotationModule(); this.registerModule(jaxbModule); this.setSerializationInclusion(JsonInclude.Include.NON_NULL); this.setSerializationInclusion(JsonInclude.Include.NON_EMPTY); }
source share