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?
The Jersey RESTful Web Services, formerly Glassfish Jersey, currently Eclipse Jersey, framework is an open source framework for developing RESTful Web Services in Java. It provides support for JAX-RS APIs and serves as a JAX-RS (JSR 311 & JSR 339 & JSR 370) Reference Implementation.
Jersey is Sun's production quality reference implementation for JSR 311: JAX-RS: The Java API for RESTful Web Services. Jersey implements support for the annotations defined in JSR-311, making it easy for developers to build RESTful web services with Java and the Java JVM.
Jersey framework implements JAX-RS 2.0 API, which is a standard specification to create RESTful Web Services. This tutorial will also teach you how to setup JDK, Tomcat and Eclipse on your machine before you the Jersey Framework is setup.
JAX-RS is only a specification and it needs a compatible implementation to be used. On the other hand, Spring MVC is a complete framework with REST capabilities. Like JAX-RS, it also provides us with useful annotations to abstract from low-level details.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With