Reputation: 1946
The way I understand it is Java EE 6 includes the classes for java.ws.rs (JAX-RS) which are defined in the JSR 311 spec document. But I don't know why you would use Jersey or Apache CXF if the base classes are already built into Java EE 6. Can you not create a RESTful web service with those classes alone? Are Jersey, Apache CXF, etc just frameworks to make development of REST-based web services easier?
Upvotes: 13
Views: 7869
Reputation: 346260
why you would use Jersey or Apache CXF if the base classes are already built into Java EE 6. Can you not create a RESTful web service with those classes alone?
Java EE only defines standards, those classes are the standard API, but there is no implementation behind them. Jersey and CXF are competing implementations of the standard.
However, if you have a server that claims to support Java EE 6, it will have to contain an implementation for every API that's in the standard. For example, Glassfish includes Jersey, so you don't have to add it explicitly.
Upvotes: 17
Reputation: 359776
JAX-RS is just a specification. In order to use JAX-RS, you need an implementation of the spec.
Jersey is a JAX-RS implementation. Specifically, it is the reference implementation.
Upvotes: 8