Retrieving header parameters in JAX-RS annotated method

The post explains different ways of retrieving header parameters in JAX-RS annotated method. Below is the complete code 1 package resource; 2 3 import javax.ws.rs.GET; 4 import javax.ws.rs.HeaderParam; 5 import javax.ws.rs.Path; 6 import javax.ws.rs.core.Context; 7 import javax.ws.rs.core.HttpHeaders; 8 import javax.ws.rs.core.MediaType; 9 import javax.ws.rs.core.Response; 10 11 @Path(“webresource3”) 12 public class WebResource3 { 13 @GET 14 @Path(“headerParameters1”)…… Continue reading Retrieving header parameters in JAX-RS annotated method

Retrieving query parameters in JAX-RS annotated method

The post explains different ways of retrieving query parameters in JAX-RS annotated method. Below is the complete code 1 package resource; 2 3 import javax.ws.rs.GET; 4 import javax.ws.rs.Path; 5 import javax.ws.rs.QueryParam; 6 import javax.ws.rs.core.Context; 7 import javax.ws.rs.core.MediaType; 8 import javax.ws.rs.core.Response; 9 import javax.ws.rs.core.UriInfo; 10 11 @Path(“webresource2”) 12 public class WebResource2 { 13 @GET 14 @Path(“queryParameters1”)…… Continue reading Retrieving query parameters in JAX-RS annotated method