Jersey 2.0

REST POST method with Example – RESTful Web Services Tutorial

6 months ago codedestine 0
In REST POST is a method level annotation, this annotation indicates that the following method will respond to the HTTP POST request only. It is used to create or update a resource. The actual function performed by the POST annotated method is determined by the server side implementation and is usually dependent on the requested URI. The entity enclosed Read More

REST PUT with Example – RESTful Web Services Tutorial

6 months ago codedestine 0
In REST PUT is a method level annotation, this annotation indicates that the following method will respond to the HTTP PUT request only. It is used to create or update a resource. PUT annotated method puts a resource at a specific URI, if a resource is already present at that URI then PUT replace or update that resource and Read More

REST GET with Example – RESTful Web Services Tutorial

6 months ago codedestine 0
In REST GET is a method level annotation, this annotation indicates that the following method will respond to the HTTP GET request only. It is used to get a resource identified by requested URI. Let’s try to understand it with an example. REST GET method Example 1 :- In this example, we will hit this URL <base URL>/books Read More

JAX-RS @HeaderParam with Example – RESTful Web Services Tutorial

6 months ago codedestine 0
In JAX-RS @HeaderParam annotation is used to bind HTTP request header values to the method arguments.  Let’s try to understand it with an example. Example 1 :- In this example of JAX-RS @HeaderParam, we will hit this URL <base URL>/books/chapters to print values of  “User-Agent” and “Accept-Language” parameter from the request header. Result :- Example 2 :- In Read More

JAX-RS @MatrixParam with Example – RESTful Web Services Tutorial

6 months ago codedestine 0
In JAX-RS @MatrixParam annotation is used to bind matrix parameter value defined in the @Path ( URL ) expression to the method arguments. Matrix parameters are a set of “name=value” pairs separated by a semi colon “;” in URI path, for example :- URL :- <base URL>/books/query;from=10;to=100;orderBy=books Let’s try to understand it with an example. Example Read More

Introduction to JAX RS API’s – RESTful Web Services Tutorial

6 months ago codedestine 0
JAX RS stands for Java API for RESTful Web Services. It is a specification for creating RESTful Web Services in Java. These specification are defined via Java Specification Request (JSR) 311. It uses annotations to define the RESTful Web Services. Since it is a specification only, we need to use it’s implementation libraries like Jersey or RESTEasy to create RESTful Read More

JAX-RS @QueryParam with Example – RESTful Web Services Tutorial

6 months ago codedestine 0
In JAX-RS @QueryParam annotation is used to bind query parameter value defined in the @Path ( URL ) expression to the method arguments.  Let’s try to understand it with an example. Example 1 :- In this example of JAX-RS @QueryParam, we will send two query parameters ( from and to ) in the @Path expression Read More

JAX-RS @PathParam with Example – RESTful Web Services Tutorial

6 months ago codedestine 0
In JAX-RS @PathParam annotation is used to bind parameter value defined in the @Path ( URL ) expression to the method arguments.  Let’s try to understand it with an example. Example 1 :- In this example, we will send one parameter ( book id ) in the @Path expression books/{id}. If we hit this URL <base Read More