users@jax-rs-spec.java.net

[jax-rs-spec users] [jsr339-experts] Re: Re: Passing data from filters to resource

From: Bill Burke <bburke_at_redhat.com>
Date: Mon, 03 Jun 2013 12:33:23 -0400

On 6/3/2013 12:30 PM, Sergey Beryozkin wrote:
> On 29/05/13 16:33, Jan Algermissen wrote:
>>
>> On 29.05.2013, at 17:16, Santiago Pericas-Geertsen
>> <Santiago.PericasGeertsen_at_oracle.com> wrote:
>>
>>>
>>> On May 29, 2013, at 8:32 AM, Bill Burke <bburke_at_redhat.com> wrote:
>>>
>>>> I wouldn't inject the ServletContext as this is a global thing, but
>>>> instead the HttpServletRequest. Sucks we can't do this in JAX-RS.
>>>> This was an oversight by us I think.
>>>
>>> Yes, I believe that was an oversight for the non-servlet case. JIRA?
> HttpServletRequest can be injected, right ?
>>
>> Can do - but what is best from an impl. POV? Add a getProperty(String)
>> to Request? Does that work seamlessly in Jersey/Resteasy/CXF?
>>
> Marek insisted the other day that ContainerRequestContext.setProperty is
> tied to HttpServletRequest.setAttribute, so it can allow for passing the
> data between filters and the resource (which will use the injected
> HttpServletRequest), definitely works in CXF
>

Should work for us too. We still need a fix for this in Jaxrs 2.1 as
depending on HttpServletRequest kinda sucks.

-- 
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com