Thursday, July 24, 2014

JAX-RS Tutorials: REST API using Java

jax-rs-tutorials


JAX-RS is API specification for RESTful web services using Java. RESTful web services is implementation of REST (Representational State Transfer) which is architectural design for distributed system or in general we can say JAX-RS is a set of APIs to develop REST service. 

This is a brief introduction about REST and JAX-RS. You can find more information on REST on Wiki and JAX-RS Official Site.

What is REST?


  1. Representational state transfer is an abstraction of the architecture of the World Wide Web. More precisely, REST is an architectural style consisting of a coordinated set of architectural constraints (source Wikipedia)

    As JAX-RS is only a specification, we need to use it's implemented library to create RESTful web service.

  2. Following are such list of libraries

    • RESTeasy, JBoss's implementation.
    • Restlet, created by Jerome Louvel, a pioneer in REST frameworks

    For this JAX-RS tutorials set we will use Jersey library and Maven for dependency management.


Quick Start

Following are some start-up JAX-RS examples.

  • Simple Hello World Example 
    simple 
    JAX-RS tutorial, which sends “Hello World” text as response string using JAX-RS API and Jersey implementation.
  • JSON Response Example

Zainul Abedin Shaikh

Founder of Zainabed, Passionate about programming. Follow him on Twitter

And if you enjoyed this post, please consider sharing it on Facebook, Google+ or Twitter below