JAX-RS Hello World Example in Jersey Framework

In this tutorial we will see how to develop simple hello world Restful example in Jersey Framework.

in this tutorial we are using Jersey 2.0


1. Create Dynamic web project in Eclipse.

I am not using Maven here, I have uploaded all the required jars with example ,and you can download total application.The project structure will look like as below.



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

In the above java service class we have implemented the service “sayHello” and we can call this service by using below url.


Here RestHelloworldExample is our application context , rest will matching web.xml , and hello is the actual path configured to invoke “sayHello” service.




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 *

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