cxf-users mailing list archives

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

Hi,

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:

@Resource
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
HttpServletRequest:

"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:

@Resource
private HttpServletRequest request;

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

Cheers,

Mickael
-- 
View this message in context: http://www.nabble.com/JAX-RS%3A-HttpServletRequest-resource-injection-tp16418423p16418423.html
Sent from the cxf-user mailing list archive at Nabble.com.


Mime
View raw message