JAX-RS Basics

 

What does JAX-RS stand for?

Java API for RESTful Web Services (X doesn’t stand for anything)

 
Why do I need to learn about JAX-RS?
  • It's a Java API designed to ease the development of services based on REST architecture.
  • Part of Java EE 5
  • Java API designed to ease the development of service based on REST architecture.
  • Supports building and deployment of RESTful webservices.
  • Annotations can be used to simplify the development
  • JAX-RS annotations are runtime annotations
 
What is REST architecture?
REST defines a set of architectural principles which define how the http methods(consistent with the protocol definition) are explicitly used to manipulate and transfer the systems resources. 
 
Example :
 
 HTTP GET to retrieve a resource
 HTTP POST to create a resource
 HTTP PUT to update a resource
 HTTP DELETE to remove a resource
 
What is required to Develop JAX-RS web services ?
In order to develop JAX-RS web services we need to have an implementation of JAX-RS API
Available implementations are 
  • CXF
  • Jersey
  • RESTEasy
  • Restlet
For most of the app servers these implementation are part of shared libraries. Recommended approach is to make the implementations as part of the war deployment rather than depending on the provided shared libraries to have independence over the version.
Web Analytics