Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Register sensible default HTTP Message Converters based on what is available in the classpath [SPR-6375] #11042

Closed
spring-projects-issues opened this issue Nov 17, 2009 · 6 comments
Assignees
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

Keith Donald opened SPR-6375 and commented

The new mvc namespace gives us a nice opportunity to add additional sensible defaults.
Proposal:

  • Register support for JAXB if Java 6+
  • Register support for JiBX if in classpath
  • Register support for JSON if Jackson in classpath

Affects: 3.0 RC2

Referenced from: commits 81d7f5b

@spring-projects-issues
Copy link
Collaborator Author

Arjen Poutsma commented

I'm not sure about Jibx, but we can detect Jaxb2 for sure.

JAXB2 can also be used on JDK 1.5, so I guess we just have to test for a JAXB2 class, rather than enable it on JDK 1.6 only.

@spring-projects-issues
Copy link
Collaborator Author

Dave Syer commented

I'm not convinced yet, either. What if my application is working fine with an auto-detected JAXB converter, and then I add Jackson to the classpath? Suddenly it breaks with no warning?

@spring-projects-issues
Copy link
Collaborator Author

Arjen Poutsma commented

Jackson and JAXB2 are not mutually exclusive (one is JSON, the other XML), so I don't understand what you mean.

@spring-projects-issues
Copy link
Collaborator Author

Dave Syer commented

I mean that I might be using JAXB in one REST endpoint and then I add another jar file with a JSON endpoint and a transitive dependency on Jackson, and suddenly my old application code breaks at runtime. Make sense?

@spring-projects-issues
Copy link
Collaborator Author

Arjen Poutsma commented

No, because we will detect for Jackson and JAXB2 separately, and can include them both if found, i.e. the two are not mutually exclusive.

@spring-projects-issues
Copy link
Collaborator Author

Arjen Poutsma commented

Done. JAXB2 and Jackson are now detected and their respective message converters are registered automatically.

@spring-projects-issues spring-projects-issues added type: enhancement A general enhancement in: web Issues in web modules (web, webmvc, webflux, websocket) labels Jan 11, 2019
@spring-projects-issues spring-projects-issues added this to the 3.0 RC3 milestone Jan 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

2 participants