JAX – RS @PathParam Annotation – Restful Example in Java

In this tutorial we will learn how @PathParam annotation will work in JAX – RS . Let us have a look in to the below example.

Here we are using Jersey 2.0 framework to implement below example. we are using Eclipse to develop this example application.

1. Create Dynamic web project in Eclipse.


2. Write Java service class.


3. Configure the Jersey Container in web.xml

Configure the Jersey Frame work ServletContainer in web xml and configure the java service classes under it by using <init-param> tag.


4. Run the Example


Deploy the applicaytion in tomcat  and,use the below url to access the param service.


in the above url we are passing parameter ” Ramesh” which will be injecting to {param}  element which is configured with @path 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 , , , , , , , .

One Comment

  1. I think the admin of this web page is genuinely working hard in favor
    of his website, because here every information is quality based data.

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.