users@jersey.java.net

Re: [Jersey] Chunking with Transfer-Encoding

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Tue, 17 Mar 2009 10:10:51 +0100

On Mar 17, 2009, at 9:50 AM, Daniel Manzke wrote:

> Hi Paul,
>
> I forgot to say that I mean the server-side. ;) Is there a way to
> force the container to use chunking?

Which server are you talking about? GF?

Note that It is not the responsibility of Jersey/JAX-RS to perform
operations at the level of transfer encoding. That is the
responsibility of the HTTP layer, like the Web container (e.g. GF or
Tomcat).

For example when i deploy the helloworld web app sample on GF v3 and
do a curl:

   # curl -v http://localhost:8080/helloworld-webapp/helloworld
   * About to connect() to localhost port 8080 (#0)
   * Trying ::1... Connection refused
   * Trying fe80::1... Connection refused
   * Trying 127.0.0.1... connected
   * Connected to localhost (127.0.0.1) port 8080 (#0)
> GET /helloworld-webapp/helloworld HTTP/1.1
> User-Agent: curl/7.16.3 (powerpc-apple-darwin9.0) libcurl/7.16.3
OpenSSL/0.9.7l zlib/1.2.3
> Host: localhost:8080
> Accept: */*
>
   < HTTP/1.1 200 OK
   < X-Powered-By: Servlet/2.5
   < Server: GlassFish/v3
   < Content-Type: text/plain
   < Transfer-Encoding: chunked
   < Date: Tue, 17 Mar 2009 09:07:41 GMT
   <
   * Connection #0 to host localhost left intact
   * Closing connection #0
   Hello World

I do not know how to set the chunk size or force the server to do
chunked encoding even if the client does not want it (i am not sure
that is a good idea). For GF you should check the configuration of the
HTTP listener in the GF admin console.


> Maybe like in JAX-WS where I have to set the CHUNK_SIZE.
>

I do not see any such property defined by the JAX-WS API.

Paul.

>
>
> Thanks,
> Daniel
>
> 2009/3/16 Paul Sandoz <Paul.Sandoz_at_sun.com>
>
> On Mar 16, 2009, at 4:10 PM, Daniel Manzke wrote:
>
> Hi,
>
> is chunking supported by Jersey? How could I enable it?
>
>
> Client or server-side?
>
> On the server-side it should be supported by the Servlet container.
> Jersey does not buffer and only attempts to set the content length
> it if knows what it is, otherwise it lets the container work it out
> what to do.
>
> Paul.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>
>
>
>
> --
> Mit freundlichen Grüßen
>
> Daniel Manzke