What difference between Jersey vs jax-rs

JavaJerseyJax Rs

Java Problem Overview


I really cant understand what really is jersey..

What I know is that Jax-RS is an API for building REST web services, and jersey? I got some information and all say the same: "jersey is an implementation of Jax-RS". But what it means?

If jax-rs is an API, why we need jersey for create a rest web service? Is jersey a couple of more libs to aim with jax-rs? if yes, jax-rs is an incomplete API?

Java Solutions


Solution 1 - Java

JAX-RS is an specification (just a definition) and Jersey is a JAX-RS implementation.

Solution 2 - Java

Straight from the jersey site

> Jersey framework is more than the JAX-RS Reference Implementation. > Jersey provides its own API that extend the JAX-RS toolkit with > additional features and utilities to further simplify RESTful service > and client development. Jersey also exposes numerous extension SPIs so > that developers may extend Jersey to best suit their needs.

Solution 3 - Java

JAX-RS is an specification and Jersey is a JAX-RS implementation.- True

This can be understood relating it to OOPS principles JAX-RS is an Interface and Jersey is a class implementing that interface.

These Specification creates a STANDARD for developing and using the web services.

There are other JAX-RS implementations too like wink, RestEasy.

JAX-RS is a specification which specifies how can we implement the web services,that what would be input type, input format, output type, its format, its configuration etc.Its Just a type declaration and its implementation are these libraries, Jersey, wink RestEasy etc.

Further, Java also have specification like JPA(Java Persistence API) and like mentioned above there is Hibernate which is an implementation of JPA.

Solution 4 - Java

JAX-RS is an specification (just a definition) and Jersey is a JAX-RS implementation. Jersey framework is more than the JAX-RS Reference Implementation. Jersey provides its own API that extend the JAX-RS toolkit with additional features and utilities to further simplify RESTful service and client development.

Solution 5 - Java

Using JAX-RS alone can not implement REST, need to register Jersey as the servlet dispatcher for REST requests on web.xml

A standard and portable JAX-RS API has been designed. Jersey RESTful Web Services framework is open source, production quality, framework for developing RESTful Web Services in Java that provides support for JAX-RS APIs and serves as a JAX-RS (JSR 311 & JSR 339) Reference Implementation.

Jersey framework is more than the JAX-RS Reference Implementation. Jersey provides it’s own API that extend the JAX-RS toolkit with additional features and utilities to further simplify RESTful service and client development. Source

For more

Restlet and Jersey are two of the most popular implementation of JAX-RS used for developing RESTful web services in Java ecosystem but there are a couple of other implementation also exist e.g. Apache Wink, Apache CXF, and JBoss RESTEasy. Source

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
Questionuser1851366View Question on Stackoverflow
Solution 1 - JavaAle ZalazarView Answer on Stackoverflow
Solution 2 - JavaorangegoatView Answer on Stackoverflow
Solution 3 - JavaShivam KashyapView Answer on Stackoverflow
Solution 4 - JavaHoriaView Answer on Stackoverflow
Solution 5 - JavaPremrajView Answer on Stackoverflow