I simply want to change the date format in my DTO returned by @ResponseBody
My question is not this question as my output is a JSON List and I am printing it on Postman
The 'jaxbContextFactory' bean is first defined in the 'webservicescommons-spring.xml' which creates the bean in the application context. So when you override the bean in your custom extension using (customExtension)-spring.xml, it is just overriding the bean in the application context. More information about context loading in Hybris can be found here.
The typeAdapters property mentioned in your comments is defined in another bean which is defined in the 'jaxb-converters-spring.xml'
<bean id="customJaxbContextFactory" parent="jaxbContextFactory">
<property name="metadataSourceFactory" ref="customMetadataSourceFactory" />
<property name="typeAdapters">
<list>
<value>de.hybris.platform.webservicescommons.jaxb.adapters.DateAdapter</value>
<value>de.hybris.platform.webservicescommons.jaxb.adapters.StringMapAdapter</value>
<value>de.hybris.platform.webservicescommons.jaxb.adapters.XSSStringAdapter</value>
</list>
</property>
</bean>
Since the beans defined in the jaxb-converters-spring-xml are loaded in the WebApplicationContext, you will need to override this bean using the (customExtension)-web-spring.xml where you can define the bean and corresponding class in the websrc of your custom extension.