You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by yong <gy...@yahoo.com> on 2010/03/09 17:28:44 UTC

How to access httpservletrequest outside service class in cxf 2.1.4?

Hi, I have seen solutions on how to access the httpservletrequest object
outside service class in cxf 2.2. Unfortunately, I am stuck with cxf 2.1.4
and can't upgrade it. Is there a way to get hold of httpservletrequest
outside service class in this version of cxf? Thank you for your help!
-- 
View this message in context: http://old.nabble.com/How-to-access-httpservletrequest-outside-service-class-in-cxf-2.1.4--tp27838104p27838104.html
Sent from the cxf-user mailing list archive at Nabble.com.


Re: How to access httpservletrequest outside service class in cxf 2.1.4?

Posted by Sergey Beryozkin <sb...@gmail.com>.
if it is an JAXRS-related query then indeed, HttpServletRequest can not be
injected as a context in 2.1.4 outside the service class, so the alternative
way to do it is as follows (not looking at the code right now but should be
close :-)) :

(HttpServletRequest)message.get(AbstractHTTPDestination.HTTP_REQUEST);

cheers, Sergey

On Wed, Mar 10, 2010 at 3:43 AM, Daniel Kulp <dk...@apache.org> wrote:

> On Tuesday 09 March 2010 11:28:44 am yong wrote:
> > Hi, I have seen solutions on how to access the httpservletrequest object
> > outside service class in cxf 2.2. Unfortunately, I am stuck with cxf
> 2.1.4
> > and can't upgrade it. Is there a way to get hold of httpservletrequest
> > outside service class in this version of cxf? Thank you for your help!
>
> I believe it should be the same for 2.1.x as 2.2.x.   Nothing has really
> changed in that regard.
>
> --
> Daniel Kulp
> dkulp@apache.org
> http://dankulp.com/blog
>

Re: How to access httpservletrequest outside service class in cxf 2.1.4?

Posted by Daniel Kulp <dk...@apache.org>.
On Tuesday 09 March 2010 11:28:44 am yong wrote:
> Hi, I have seen solutions on how to access the httpservletrequest object
> outside service class in cxf 2.2. Unfortunately, I am stuck with cxf 2.1.4
> and can't upgrade it. Is there a way to get hold of httpservletrequest
> outside service class in this version of cxf? Thank you for your help!

I believe it should be the same for 2.1.x as 2.2.x.   Nothing has really 
changed in that regard.   

-- 
Daniel Kulp
dkulp@apache.org
http://dankulp.com/blog