Skip to main content

[jsr339-experts] Re: Accessing request in WriterInterceptor.aroundWriteTo() ?

  • From: Jan Algermissen <jan.algermissen@...>
  • To: jsr339-experts@...
  • Subject: [jsr339-experts] Re: Accessing request in WriterInterceptor.aroundWriteTo() ?
  • Date: Thu, 8 Nov 2012 00:48:41 +0100


On Nov 8, 2012, at 12:40 AM, Bill Burke <bburke@...> wrote:

> Or, what you could do is write a ContainerRequestFilter and set some 
> roperites thaat contained the accept-encoding.  Then use those in the 
> WriterInterceptor.
> 

Yes, but that is absolutetly exactly what I do *not* want to do.


Jan



> On 11/7/2012 5:29 PM, Jan Algermissen wrote:
>
>> I am wondering: is there a way to access the current request in a 
>> WriterIterceptor on the container side?
>
>> What I want to do is to gzip-encode the output stream but only if the 
>> client said 'Accept-Encoding: gzip'.
>
>> Thus I'd like to be able to do sth like
>
>> @Override
>> public void aroundWriteTo(WriterInterceptorContext wCtx) ... {
>
>>     if( wCtx.getRequest().getHeader('Accept-Encoding') ... 'gzip') {
>>      ... hook in gzip output stream
>>     }
>>              
>> }
>
>
>> What do you think - or what am I missing?
>
>> Jan
>
>
>
> 
> -- 
> Bill Burke
> JBoss, a division of Red Hat
> http://bill.burkecentral.com



[jsr339-experts] Re: Accessing request in WriterInterceptor.aroundWriteTo() ?

(continued)

[jsr339-experts] Re: Accessing request in WriterInterceptor.aroundWriteTo() ?

Bill Burke 11/07/2012

[jsr339-experts] Re: Accessing request in WriterInterceptor.aroundWriteTo() ?

Jan Algermissen 11/07/2012

[jsr339-experts] Re: Accessing request in WriterInterceptor.aroundWriteTo() ?

Bill Burke 11/08/2012

[jsr339-experts] Re: Accessing request in WriterInterceptor.aroundWriteTo() ?

Jan Algermissen 11/08/2012

[jsr339-experts] Re: Accessing request in WriterInterceptor.aroundWriteTo() ?

Bill Burke 11/08/2012

[jsr339-experts] Re: Accessing request in WriterInterceptor.aroundWriteTo() ?

Jan Algermissen 11/08/2012

[jsr339-experts] Re: [jax-rs-spec users] Re: Accessing request in WriterInterceptor.aroundWriteTo() ?

Marek Potociar 11/11/2012

[jsr339-experts] Re: [jax-rs-spec users] Re: Accessing request in WriterInterceptor.aroundWriteTo() ?

Marek Potociar 11/11/2012

[jsr339-experts] Re: [jax-rs-spec users] Re: Accessing request in WriterInterceptor.aroundWriteTo() ?

Santiago Pericas-Geertsen 11/08/2012

[jsr339-experts] Re: Accessing request in WriterInterceptor.aroundWriteTo() ?

Bill Burke 11/07/2012

[jsr339-experts] Re: Accessing request in WriterInterceptor.aroundWriteTo() ?

Jan Algermissen 11/07/2012
 
 
Close
loading
Please Confirm
Close