[STARTER] JAX-RS: Jersey + Servlet 3.0 + Maven + Tomcat

Steps to configure a JAX-RS project that runs on Tomcat (here 8), Maven, Servlet 3.0 and having Jersey as a Reference Implementation.

1. Maven POM.XML dependencies:

 

2. web.xml (src/main/webapp/WEB-INF)

 

3. Application class (under: src/main/java/com/vvirlan/java/ws

4. Resource class (which is the actual web service endpoint):

 

5. Build the app as usually and deploy to tomcat webapp folder
6. Point the browser:
http://localhost:8080/demo2/rest/hello

Notes:
A. Folder layout:

screen

B. Complete pom.xml

 

Leave a Reply

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