Jersey 2 Hello World Example

Posted on Updated on

Jersey is very popular framework to build restful services. This is a basic example to help you getting start with Jersey 2. Technologies used in this examples are :

  1. Maven
  2. Jersey 2.23.1
  3. JDK 1.7
  4. Tomcat 7

1) Add below dependencies in your pom.xml.

2) Add below servlet mapping configuration into web.xml

3) Helloworld rest service class.

4) Run the application.

Run the application on any of web application server, I have used tomcat 7 and hit http://localhost:8080/code2succeed/rest/hello using browser.

helloworld jersey 2

Leave a Reply

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

Time limit is exhausted. Please reload CAPTCHA.