Skip to content

Jaxb2RootElementHttpMessageConverter doesn't allow for customizing Marshaller/Unmarshaller [SPR-11488] #16113

@spring-projects-issues

Description

@spring-projects-issues

Eric Miles opened SPR-11488 and commented

We have a need to use Spring managed beans for JAXB XmlAdapters. The only way I've found to do this is to call setAdapter(bean) on Unmarshaller and Marshaller.

Due to the base class AbstractJaxb2HttpMessageConverter making createMarshaller() and createUnmarshaller() final combined with the structure of Jaxb2RootElementHttpMessageConverter, we have no way of reaching those objects. It appears the only way I can do this and still get all the functionality of Jaxb2RootElementHttpMessageConverter is to extend it and override writeToResult and readFromSource while doing a lot of copying and pasting for most of those methods.


Affects: 4.0.1

Metadata

Metadata

Assignees

Labels

in: webIssues in web modules (web, webmvc, webflux, websocket)type: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions