新泽西和 Jax 有什么区别

我真的不明白球衣到底是什么。

我所知道的是 Jax-RS 是一个用于构建 REST Web 服务的 API,还有 Jersey? 我得到了一些信息,它们都说了同样的话: “ jersey 是 Jax-RS 的一个实现”。但它的意思是什么呢?

如果 jax-rs 是一个 API,为什么我们需要运动衫来创建一个静息 Web 服务?新泽西是不是 Jax 的另一个目标?如果是,jax-rs 是一个不完整的 API 吗?

52534 次浏览

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.

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

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.

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.

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