We will be focussing on developing and deplying REST web services in Java platform, and hence will be using the tools and technologies for the same. Basic concept of web service development is almost similar for each language with a few difference.
Let's discuss about both of them in detail.
Java API for RESTful Web Services (JAX-RS) is a Java programming language specification that supports creating web services according to the REST architectural pattern in Java. JAX-RS uses annotations, included in Java SE-5, to simplify the deployment of web service clients and the end points.
It provides annotations to help in mapping a resource class (a POJO) as a web resource. These annotations include:
In addition to these, it provides several other annotations, which are also quite useful when it comes to the development of web service.
It is important to note that JAX-RS is just a specification. It needs some implementation to work. JAX-RS can be seen as the interface, which contains all the specifications, more like a function which is exposed using a URI on Internet. But this function needs a definition/implementation, which contains the actual logic.
There are several implementation of the JAX-RS. Some famous one includes:
Jersey is the reference implementation of the JAX-RS annotations. The Java API for RESTful Web Services, Jersey implements support for the annotation defined in the JSR-311, making it easy for the developers to build RESTful web services with Java and Java JVM. Jersey also specifies client libraries to help communicate with RESTful webservices.