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: javax.servlet.http.HttpServletRequest.getMethod()
.
However, now I'm working with an embedded Grizzly server on my application and have found the following error on startup:
Missing dependency for constructor public wci.api.resource.AudioSessionResource(javax.servlet.http.HttpServletRequest) at parameter index 0
All my resources extends a MyHappyCustomResource
class that has a constructor which receives an HttpServletRequest
, provided by the resource constructor via Injection.
This is an example of a resource constructor, the super
call is from MyHappyCustomResource
:
import javax.servlet.http.HttpServletRequest;
public AudioSessionResource(@Context HttpServletRequest request) {
super(request);
this.dao = new AudioSessionDao(this.sessionManager.getCurrentSession());
}
Right now I need this just to get the HTTP-Method so, any other or more correct way to do it it's appreciated.