In this Spring REST tutorial, we will learn how to perform CRUD Operations (Create, Read, Update, Delete) using Spring RESTful Web Services with the support of Hibernate JPA. In REST, manipulation of the resources is performed based on the common set of HTTP verbs. POST - To Create a resource GET - To Retrieve a resource PUT - To Update a resource DELETE - To … [Read more...]
Spring RESTful Web Services Hello World XML Example
In this Spring RESTful Web Services example, we will learn how to create a RESTful Web Services directly through Spring Framework rather than creating it through REST implementation such as Jersey. In this article, we will create a REST service which returns XML representation of the Object. … [Read more...]
Spring REST Hello World Example – JSON and XML responses
As we already know Spring Core, Spring MVC and REST Web service. Now its our turn to learn Spring with REST Web services as a single entity. In this Spring REST Example we will be learning how to produce JSON and XML response by creating a simple REST service using Spring 4. … [Read more...]
JAX-RS REST @Consumes both XML and JSON Example
Previously we have learnt how to use @Produces annotation, Consuming JSON or Consuming XML separately. We have consumed either xml or json request but not both xml and json in a single method. In this example we will learn how to consume multiple media type which the client is giving as input, lets see how we can achieve it. … [Read more...]
JAX-RS REST @Produces both XML and JSON Example
In my previous article we have learnt how to use @Produces annotation. We have produced either xml or json response but not able to produce both xml and json in a single method. In this example we will learn how to produce multiple media type response depending upon the clients request we will produce response, lets see how we can achieve it. … [Read more...]
JAX-RS REST @Consumes Example
Previously we have learnt about how to produce different types of responses using @Produces annotation, In this article we will learn how to consume different types of request from the user using @Consumes annotation. @Consumes annotation is used to specify the MIME media types that a resource can consume. @Consumes can be applied at both class level and method level, If … [Read more...]
JAX-RS REST @Produces Example
Previously we have learnt about how to get parameters using @PathParam, @QueryParam, @Context, @FormParam, @MatrixParam annotations, In this article we will learn how to send different types of response back to the user using @Produces annotation. @Produces annotation is used to specify the MIME media types that a resource can produce and send back to the client. … [Read more...]
JAX-RS REST @FormParam Example
Previously we have learnt about @PathParam, @QueryParam, @Context, @MatrixParam annotations, In this article we will learn how to get the values from the Form which is getting submitted using @FormParam annotation. … [Read more...]
JAX-RS REST @MatrixParam Example
We already know how to get the values using @QueryParam, @Context and get path parameter using @PathParam annotation, now lets learn how to get the value of a Matrix parameter passed using @MatrixParam Annotation. Matrix Parameter will be in the form of Key Value pairs separated by semicolon (;) … [Read more...]
JAX-RS @Context Example
In our previous example we have learnt how to get the values using @QueryParam Annotation, now we will learn the usage of @Context annotation in getting the Query Parameters. … [Read more...]
JAX-RS @DefaultValue Example
In our previous example we have learnt how to get the values using @QueryParam Annotation, now we will learn the usage of @DefaultValue annotation with @QueryParam. @DefaultValue is used to set a default value to the query param even when the parameters are not passed. … [Read more...]
JAX-RS @QueryParam Example
We know there are two ways to pass the parameter in a GET request of the REST Service. First way is using @PathParam and the Other way is using @QueryParam. We have already learnt how to use @PathParam annotation, Now lets look into @QueryParam in this tutorial. … [Read more...]