JAX – RS @ApplicationPath Annotation(no web.xml)Example in jersey

In this tutorial we will learn how to develop a restful web services application with out web.xml. We have an annotation @ApplicationPath provided by JAX – RS which is used to achieve this. This can be used only in above servelt3.0 complaint containers (ex:Tomcat7 …).

let us have a small example.

1. Create Dynamic web project in Eclipse.


2. Write Java Resource classes.


3. Write a configuration class instead of  web.xml


4. Run the Example

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


hit the url http://localhost:8080/RestfulApplicationPathAnnotationExample/resources/hello   we will get below output.




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.