JAX-RS 2.0 is a framework that helps you in writing the RESTful web services on the client side as well as on the server side. Jersey 2.0 is the reference implementation of the JAX-RS 2.0 (JSR 339 specification). Along with the enhancements in Java EE 7, JAX-RS 2.0 has also been revised dramatically.
The following is a list of the RESTful principles that must be followed:
An ID should be assigned to everything
Things should be linked together
A common set of methods must be used
Multiple representations should be allowed
Stateless communication must be kept
Before moving ahead, let's look at the existing features of JAX-RS 1.0:
JAX-RS 2.0 remains consistent with the central theme of Java EE 7, but it contains other long-awaited APIs too. These APIs are mostly focused around what is referred to as Simplified API. They can be categorized as follows:
However, Jersey 2.0 can be deployed on several web containers that support Servlet 2.5 or higher, Grizzly 2 HTTP server (which is also the default server for testing), and OSGi containers. For the new async feature of JAX-RS 2.0, Server-Side Events (SSE), we need containers supporting Servlet 3.0.