You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cxf.apache.org by Aaron Titus <at...@fwdco.com> on 2014/11/29 02:57:06 UTC

Re: Any way to get access to request and response parameters and cookies?

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.philippe@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
>

Re: Any way to get access to request and response parameters and cookies?

Posted by Sergey Beryozkin <sb...@gmail.com>.
Hi - JAX-RS also offers Cookie and NewCookie utility support
Cheers, Sergey
On 29/11/14 01:57, Aaron Titus wrote:
> 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.philippe@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
>>
>