When to use PathParam and when to use QueryParam

In this article, we will see difference between PathParam and QueryParam and how to decide whether to use PathParam vs QueryParam in rest api design.   Diff between PathParam and QueryParam Path params are part of the url where as query parameters are added after the ? mark symbol and separated from other query parameters […]

JAX-RS HTTP Method Annotations

This article discusses about @GET, @PUT, @POST, @DELETE and @HEAD annotations defined by JAX-RS for corresponding HTTP methods. JAX-RS HTTP Method Annotations   JAX-RS provides the following annotations to map to corresponding HTTP operations.   @GET   HTTP GET method retrieves information from a resource. GET method calls are handled by JAX-RS methods annotated with […]

Standalone Restful service using Restlet framework

In this article, we will create a standalone Restful web service using Restlet framework and Maven.   If you need help setting up Maven, refer this article :   Maven basics   Let’s create a standalone java application by using the following archetype in command prompt:   mvn archetype:generate -DarchetypeArtifactId=maven-archetype-quickstart -DgroupId=com.topjavatutorial.app -DartifactId=RestletStandAloneApp -DinteractiveMode=false   Open […]


RESTful CRUD operations using Jersey and Hibernate

Here are the objectives of this article :   – Use Maven to create a Jersey JAX-RS service   – Modify the service class to provide GET, POST, UPDATE,DELETE operations   – Use Hibernate to connect to the MySQL database and perform the CRUD operations   Tools/Technologies:   Jersey Hibernate Maven MySQL database Eclipse   […]

Jersey Rest client

In this article, we will create a REST client using Jersey framework for testing GET, POST, PUT and DELETE operations.   This client will be invoking a service that is deployed locally on Tomcat server.   We created the RESTful Service created using Jersey and Hibernate in this article :   RESTful service using Jersey […]