Hi,
Things might get clearer if you look at the container gzip filter
javadoc [1].
Two headers, content-encoding/accept-encoding are used there
to determine if the received data needs decoding and if the response
data should get encoded. The filter is not configured automatically,
you need to add it to your application explicitly.
On the client side, you can use the client GZIPContentEncodingFilter, a
counterpart for
the above filter, which takes care of decoding/encoding/headers on the
client side for you.
See [2] for details.
HTH,
~Jakub
[1]
http://jersey.java.net/nonav/apidocs/latest/jersey/com/sun/jersey/api/container/filter/GZIPContentEncodingFilter.html
[2]
http://jersey.java.net/nonav/apidocs/latest/jersey/com/sun/jersey/api/client/filter/GZIPContentEncodingFilter.html
On 9.11.2011 11:12, tyo07 wrote:
> Hi, i have little problem with compression in Jersey. Using a simple
> compression from string to byte for example
>
> //Server
> public String method()
> {
> return compressThis("a String")<- this will return as a byte[] in my
> compression method
> }
>
>
> //client
> String getStrComp = webResource.accept some path<- this one will call that
> method above. Calling a function that returned as String of byte, and fill
> it into string..sounds strange.
>
> problem is, returned string is not the same again like one before
> compression. I might be wrong at this but looks like string that returned to
> client is not returned like true string of "byte". I think it's malformed or
> something.
>
> Getting this problem, i try to look another method and see GZIP encoding in
> jersey but don't really understand the purpose. Is it planted on server? and
> it automatically set the header so if no header sent to the server, then the
> information that sent back to the client was encoded?how to re-decode it
> again at client side?
>
> Is there any easier method to encrypt/compression in Jersey?
> Thanks
>
>
>
> --
> View this message in context: http://jersey.576304.n2.nabble.com/Compression-Encryption-in-Jersey-tp6977449p6977449.html
> Sent from the Jersey mailing list archive at Nabble.com.
>