Show Topics
Hide Topics

JAX-RS @HeaderParam Example

 

We can get the HTTP header details using JAXRS. HTTP headers like below format

We have two ways to get HTTP request header in JAX-RS :

  1. Inject directly with @HeaderParam
  2. Pragmatically via @Context

 

1.Create Dynamic web project in eclipse, convert that into Maven Project

 

 

2.Add Jersey jar files manually / through Maven by writing repo details in pom.xml

 

 

3.Create RESTFul webservice

 

 

4.Configure web.xml

 

 

5.Test Webservice directly by using URL / writing webservice client

http://localhost:8080/JAXRS-HeaderParam-Example/rs/headerparam

 

Download Example Code