An overview of JAX-RS

There are many tools and frameworks available in the market today for building RESTful web services. You can use tools of your choice as long as the REST implementation meets the RESTful architectural constraints discussed in the first chapter. There are some recent developments with respect to the standardization of various framework APIs by providing unified interfaces for a variety of implementations. Let's take a quick look at this effort.

As you may know, Java EE is the industry standard for developing portable, robust, scalable, and secure server-side Java applications. The Java EE 6 release took the first step towards standardizing RESTful web service APIs by introducing a Java API for RESTful web services (JAX-RS). JAX-RS is an integral part of the Java EE platform, which ensures portability of your REST API code across all Java EE-compliant application servers. The first release of JAX-RS was based on JSR 311. The next version, JAX-RS 2 (based on JSR 339), was released as part of the Java EE 7 platform. The latest version, JAX-RS 2.1 (based on JSR 370), is part of the Java EE8 platform. There are multiple JAX-RS implementations available today by various vendors. Some of the popular JAX-RS implementations are as follows:

  • Jersey RESTful web service framework: This framework is an open source framework for developing RESTful web services in Java. It serves as a JAX-RS reference implementation. You can learn more about this project at https://jersey.github.io/.
  • Apache CXF: This framework is an open source web services framework. CXF supports both JAX-WS and JAX-RS web services. To learn more about CXF, refer to http://cxf.apache.org.
  • RESTEasy: This framework is an open source project from JBoss, which provides various modules to help you build a RESTful web service. To learn more about RESTEasy, refer to http://resteasy.jboss.org.
  • Restlet: This framework is a lightweight open source RESTful web service framework. It has good support for building both scalable RESTful web service APIs and lightweight REST clients (which suits mobile platforms well). You can learn more about Restlet at http://restlet.com.

We will be using the Jersey implementation of JAX-RS for running the examples discussed in this book (unless otherwise specified). Remember that you are not locked down to any specific vendor here; the RESTful web service APIs that you build using JAX-RS will run on any JAX-RS implementation as long as you do not use any vendor-specific APIs in the code.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.142.40.32