cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mickael Goujon <>
Subject JAX-RS: HttpServletRequest resource injection
Date Tue, 01 Apr 2008 15:05:19 GMT


I currently use the JAX-WS WebServiceContext resource injection in my
service bean to be able to access the HttpServletRequest in my SOAP web
services and this works well:

private WebServiceContext context;

I now need to implement the same web service as a REST service. CXF
2.1-incubator is great because it includes the JAX-RS frontend, but resource
injection doesn't seem to work. 
Form the 0.6 specs, in section 5.1, I should be able to access the

"The javax.annotation.Resource annotation can be used to indicate a
dependency on a Servlet-defined resource. An implementation MUST support
injection of the following types: ServletConfig, ServletContext,
HttpServletRequest and HttpServletResponse."

I thought this simple code would be sufficiant, but apparently it isn't:

private HttpServletRequest request;

Resource injection is quite new to me, so maybe I'm doing something wrong.
Can somebody help?


View this message in context:
Sent from the cxf-user mailing list archive at

View raw message