title: Simple Hello world RESTful Webservice showing 404 error
body: <p>We are trying to build a RESTful webservice to print Hello World but on running it is giving file not found error.</p>
  
  <p><strong>java file:</strong></p>
  
  <pre><code>package com.gslabs.contact;
  
  import javax.ws.rs.*;
  import javax.ws.rs.core.MediaType;
  
  @Path("/Contact")
  public class ContactREST {
  
      @GET
      @Produces(MediaType.TEXT_HTML)
      public String gethtmlcontact_info()
      {
              return "&lt;html&gt;"+"&lt;title&gt;"+"Contact-info"+"&lt;/title&gt;"+"&lt;body&gt;&lt;h1&gt;"+"Contact-Info"+"&lt;/body&gt;&lt;/h1&gt;&lt;/html&gt;";
  
      }
      @GET
      @Produces(MediaType.TEXT_PLAIN)
      public String getXMLcontactinfo()
      {
          return "Contact info";
      }
  
  }
  </code></pre>
  
  <p><strong>web.xml</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0"&gt;
    &lt;display-name&gt;RestfulWS&lt;/display-name&gt;
    &lt;servlet&gt;
      &lt;servlet-name&gt;Rest Service&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.gslabs.contact&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;Contacts Info&lt;/servlet-name&gt;
      &lt;url-pattern&gt;/rest/*&lt;/url-pattern&gt;
    &lt;/servlet-mapping&gt;
  &lt;/web-app&gt;
  </code></pre>