So far, we have discussed what web services are, how to implement them in a REST style, and the different HTTP methods and status codes. Now that we're familiar with these, let's take a look at the RESTful services in action.
We use Jersey to implement a RESTful web service. Jersey RESTful Web Services is an open source framework for developing RESTful web services. It is a reference implementation of JAX-RS and it provides support for JAX-RS APIs. It adds some of its own features and APIs that extend from the JAX-RS toolkit for the simplification of web service development.
We will create a Maven web project, add the Jersey dependency, and define resources and functions in order to respond to the HTTP request.
Create a Maven web project and add the dependencies as follows:
<dependency>
<groupId>com.sun.jersey...