title: Jersey hello world displays nothing
body: <p>I am new in rest web service with jersey, (with <code>tomcat</code>)</p>
  
  <p>I have a <code>HelloWorld</code> source: (in the <code>RestApp</code> package)</p>
  
  <pre><code>package com.ss.hh;
  ...
  
  @Path("/hello")
  public class HelloWorld {
  
      @GET
      @Produces(MediaType.TEXT_PLAIN)
      public String getMessage(){
          return "Hello jersey";
      }
  }
  </code></pre>
  
  <p>And here is the <code>web.xml</code>:</p>
  
  <pre><code>&lt;servlet&gt;
      &lt;servlet-name&gt;jersey-serlvet&lt;/servlet-name&gt;
      &lt;servlet-class&gt;
          com.sun.jersey.spi.container.servlet.ServletContainer
      &lt;/servlet-class&gt;
  
      &lt;init-param&gt;
          &lt;param-name&gt;com.sun.jersey.config.property.packages&lt;/param-name&gt;
          &lt;param-value&gt;com.ss.hh&lt;/param-value&gt;
      &lt;/init-param&gt;
      &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
  &lt;/servlet&gt;
  
  &lt;servlet-mapping&gt;
      &lt;servlet-name&gt;jersey-serlvet&lt;/servlet-name&gt;
      &lt;url-pattern&gt;/*&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
  </code></pre>
  
  <p>And in <code>pom.xml</code>:</p>
  
  <pre><code>&lt;dependency&gt;
      &lt;groupId&gt;org.glassfish.jersey.core&lt;/groupId&gt;
      &lt;artifactId&gt;jersey-server&lt;/artifactId&gt;
      &lt;version&gt;2.19&lt;/version&gt;
  &lt;/dependency&gt;
  
  &lt;dependency&gt;
      &lt;groupId&gt;com.sun.jersey&lt;/groupId&gt;
      &lt;artifactId&gt;jersey-servlet&lt;/artifactId&gt;
      &lt;version&gt;1.19&lt;/version&gt;
  &lt;/dependency&gt;
  </code></pre>
  
  <p>Why i can't get the <code>Hello jersey</code> message in <code>http://localhost:8080/hello</code>? </p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>I replace the <code>jersey-servlet</code> with <code>jersey-container-servlet-core</code> file and changed the <code>web.xml</code> configures as below:</p>
  
  <pre><code>&lt;servlet&gt;
      &lt;servlet-name&gt;Jersey REST Service&lt;/servlet-name&gt;
      &lt;servlet-class&gt;org.glassfish.jersey.servlet.ServletContainer&lt;/servlet-class&gt;
      &lt;init-param&gt;
          &lt;param-name&gt;jersey.config.server.provider.packages&lt;/param-name&gt;
          &lt;param-value&gt;com.ss.hh&lt;/param-value&gt;
      &lt;/init-param&gt;
      &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
  &lt;/servlet&gt;
  &lt;servlet-mapping&gt;
      &lt;servlet-name&gt;Jersey REST Service&lt;/servlet-name&gt;
      &lt;url-pattern&gt;/*&lt;/url-pattern&gt;
  &lt;/servlet-mapping&gt;
  </code></pre>
  
  <p>But it not displays anything on: <a href="http://localhost:8080/FirstRestApp/hello" rel="nofollow">http://localhost:8080/FirstRestApp/hello</a></p>
  
  <p><code>FirstRestApp</code> is the project name.</p>