Skip to main content

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

  • From: Bill Burke <bburke@...>
  • To: jsr339-experts@...
  • Subject: [jsr339-experts] Re: Accessing request in WriterInterceptor.aroundWriteTo() ?
  • Date: Wed, 07 Nov 2012 18:40:44 -0500

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

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] Accessing request in WriterInterceptor.aroundWriteTo() ?

Jan Algermissen 11/07/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

[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