title: The specified HTTP method is not allowed for the requested resource in Rest web services
body: <p>i am using restful webservices
  I have a simple code as given below:</p>
  
  <pre><code>@Path("/v1/status")
  public class ControllerServices 
  {
      @GET
      @Produces(MediaType.TEXT_HTML)
      String printOnly()
      {
          System.out.println("running successfully");
          return "&lt;p&gt;this webservice&lt;/p&gt;";
      }
  
  
  }
  </code></pre>
  
  <p>And my <code>web.xml</code> file goes like this:</p>
  
  <pre><code>    &lt;servlet&gt;
      &lt;servlet-name&gt;Jersey 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.techbloomer.services&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;/rest/*&lt;/url-pattern&gt;
    &lt;/servlet-mapping&gt;
  </code></pre>
  
  <p>When I request</p>
  
  <pre><code>http://localhost:8080/webservicesForIndTadka/rest/v1/status
  </code></pre>
  
  <p>it gives the error as</p>
  
  <pre><code>HTTP Status 405 - Method Not Allowed
  type: Status report
  message: Method Not Allowed
  description: The specified HTTP method is not allowed for the requested resource.
  </code></pre>