-
Dec 5th, 2012, 01:17 PM
#1
Custom JAXB adapter not working with Spring JAXB2Marshaller
I am trying to add custom JAXB adapter for date formatting.
The <oxm:jaxb2-marshaller../> tag does not have option to add adapters.
I checked the Javadoc of org.springframework.oxm.jaxb.Jaxb2Marshaller and found property adapters. So I decided to create a bean using regular <bean> tag instead of <oxm:jaxb2-marshaller../> configuration. And I added the adapter in the property of this bean.
<bean id="jaxbMarshaller" class="org.springframework.oxm.jaxb.Jaxb2Marshalle r">
<property name="contextPath" value="...." />
<property name="adapters">
<list>
<bean class=".....DateTimeConverterAdapter" />
</list>
</property>
</bean>
This adapter never gets called.
Same adapter class works if I configure it in package-info.java in the JAXB generated Java beans.
Am I missing something? Thanks in advance.
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