Re: JSR311: gzip encoding

From: Ryan McDonough <>
Date: Fri, 27 Mar 2009 16:19:22 -0400

Is an @GZip annotation too specific though? The HTTP spec defines more than
one encoding token, with GZip only being one such value. It might be useful
to define a @ContentEncoding annotation that takes an array of possible
string values. For example:

@ContentEncoding({"gzip","deflate", "compress'})
public class Foo {...

The implmentation would then determine the proper encoding method based on
the Accept-Encoding header.


On Fri, Mar 27, 2009 at 11:25 AM, Paul Sandoz <> wrote:

> On Mar 25, 2009, at 9:58 PM, Bill Burke wrote:
> It seems to me that most JAX-RS implementations support GZIP encoding. Any
>> way we could require it within the specification? Also maybe define a @GZIP
>> annotation to specify we want to encode the response (of course it would be
>> sensitive to the Accept-Encoding header).
>> In Resteasy we encode the response in GZIP if the content-encoding
>> response header has been set. Our @GZIP annotation sets the
>> content-encoding header.
>> It just seems weird to me that there is no portable way of doing encoding
>> within JAX-RS.
> I agree. There are probably a bunch of little cases like this.
> Could you log an issue so we can track it?
> Paul.
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

Ryan J. McDonough