you can import javax.ws.rs.core.Context;
and then @Context ServletContext rsContext; This will result in the normal ServletContext getting injected. From there you can get the request info, etc. On Thu, Nov 27, 2014 at 10:05 PM, Colbert Philippe < colbert.phili...@gmail.com> wrote: > I am using Java with Apache CXF to write the backend for single-page web > site (like AngularJS and others). In my REST service function, I need > access to the header of the http request (i.e. parameters and cookies) and > I need access to the response header also (i.e. parameters and cookies). > I > need to read and possibly write parameters and cookies. The reason for > this are important! I need to implement security features and session > management. Those are important reasons indeed! > > > > Is there a way of getting access to both of these structures from within a > web service function in Apache CXF RESTfull code? > > > > If it is not possible at this point, I strongly recommend that you > implement a solution. A solution might be to create some new dependency > injection annotations that would give access to these structures like > @RequestCookie, @RequestParam, @ResponseCookie, @ResponseParam >