user1851366
user1851366

Reputation: 346

What difference between Jersey vs jax-rs

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?

Upvotes: 111

Views: 58069

Answers (5)

Premraj
Premraj

Reputation: 74551

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

Upvotes: 2

Shivam Kashyap
Shivam Kashyap

Reputation: 91

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.

Upvotes: 6

Horia
Horia

Reputation: 48

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.

Upvotes: 3

orangegoat
orangegoat

Reputation: 2683

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.

Upvotes: 27

Ale Zalazar
Ale Zalazar

Reputation: 1980

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

Upvotes: 112

Related Questions