JAX-RS @QueryParam Annotation Restful Example in Java

In this tutorial we see what is the use of @QueryParam in JAX – RS. @QueryParam annotation is used to get the parameters coming form the querystring in the url  and make them available to java method to in our java service class.

Let us have a example how to implement  @QueryParam annotation in JAX-RS.

1. Create Dynamic web project in Eclipse.


2. Write Java service class.


3. Configure the Jersey Container in web.xml


4. Run the Example


After deploying the application hit below url, here we are passing 3 parameters in the url and  which are accessing in the adduser() method by using @QueryParam annotation.



NOTE : I have not included all the required jersey jars in the source code please download it from here and copy to lib folder.


Download  Source Code

Posted in webservices and tagged , , , , , , , .

Leave a Reply

Your email address will not be published. Required fields are marked *