title: How to get the HTTP request method on a Grizzly-embedded Jersey application?
body: <p>I am working on a JAX-RS application. Before, I had it as a WAR mounted on a Tomcat server and I was obtaining the HTTTP Request Method using: <code>javax.servlet.http.HttpServletRequest.getMethod()</code>.</p>
  
  <p>However, now I'm working with an embedded Grizzly server on my application and have found the following error on startup:</p>
  
  <pre><code>Missing dependency for constructor public wci.api.resource.AudioSessionResource(javax.servlet.http.HttpServletRequest) at parameter index 0
  </code></pre>
  
  <p>All my resources extends a <code>MyHappyCustomResource</code> class that has a constructor which receives an <code>HttpServletRequest</code>, provided by the resource constructor via Injection.</p>
  
  <p>This is an example of a resource constructor, the <code>super</code> call is from <code>MyHappyCustomResource</code>:</p>
  
  <pre><code>import javax.servlet.http.HttpServletRequest;
  
  public AudioSessionResource(@Context HttpServletRequest request) {
      super(request);
      this.dao = new AudioSessionDao(this.sessionManager.getCurrentSession());
  }
  </code></pre>
  
  <p>Right now I need this just to get the HTTP-Method so, any other or more correct way to do it it's appreciated.</p>