You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by fdesbois <fd...@codelutin.com> on 2010/07/08 13:34:06 UTC

Disable Transfer-Encoding chunked from StreamResponse

Hi,

I have a problem with Transfer-Encoding chunked on an kml/xml file. I
need to disable it to use the full response as one element for
OpenLayers javascript framework.

How can I disable Transfer-Encoding chunked ? I tried to do this in
the StreamResponse :

    @Override
    public void prepareResponse(Response response) {
        response.setHeader("Transfer-Encoding", null);
    }

but the Transfer-Encoding still appears in firebug...

Server	Apache-Coyote/1.1
Content-Type	application/vnd.google-earth.kml+xml
Transfer-Encoding	chunked
Date	Thu, 08 Jul 2010 11:32:07 GMT

-- 
Florian Desbois <fd...@codelutin.com>
SSLL Code Lutin
http://www.codelutin.com
tel : 02 40 50 29 28
Réseau Libre-Entreprise 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Disable Transfer-Encoding chunked from StreamResponse

Posted by fdesbois <fd...@codelutin.com>.
Le Thu, 08 Jul 2010 08:56:12 -0300,
"Thiago H. de Paula Figueiredo" <th...@gmail.com> a écrit :

> On Thu, 08 Jul 2010 08:34:06 -0300, fdesbois
> <fd...@codelutin.com> wrote:
> 
> > Hi,
> 
> Hi!
> 
> > How can I disable Transfer-Encoding chunked ? I tried to do this in
> > the StreamResponse :
> 
> I really don't know the answer, but I guess this is related to the
> server configuration, not Tapestry-related.
> 

Damn'it, thx Thiago...

A configuration may be exists in web.xml, but I find nowhere how to do
it...

-- 
Florian Desbois <fd...@codelutin.com>
SSLL Code Lutin
http://www.codelutin.com
tel : 02 40 50 29 28
Réseau Libre-Entreprise 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Disable Transfer-Encoding chunked from StreamResponse

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
On Thu, 08 Jul 2010 10:50:40 -0300, fdesbois <fd...@codelutin.com>  
wrote:

> I resolve my problem setting the Content-Length of the result Stream :
>
>     @Override
>     public void prepareResponse(Response response) {
>         response.setHeader("Content-Length", "" + length);
>     }
>
> where length = inputStream.available(); or file.length();
>
> The Transfer-Encoding is not used anymore if Content-Length is
> defined :)

Thanks for the info! It's a good ideea to set the content length header if  
you already know it, anyway. :)

-- 
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor
Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Disable Transfer-Encoding chunked from StreamResponse

Posted by fdesbois <fd...@codelutin.com>.
Le Thu, 08 Jul 2010 08:56:12 -0300,
"Thiago H. de Paula Figueiredo" <th...@gmail.com> a écrit :

> On Thu, 08 Jul 2010 08:34:06 -0300, fdesbois
> <fd...@codelutin.com> wrote:
> 
> > Hi,
> 
> Hi!
> 
> > How can I disable Transfer-Encoding chunked ? I tried to do this in
> > the StreamResponse :
> 
> I really don't know the answer, but I guess this is related to the
> server configuration, not Tapestry-related.
> 

I resolve my problem setting the Content-Length of the result Stream : 

    @Override
    public void prepareResponse(Response response) {
        response.setHeader("Content-Length", "" + length);
    }

where length = inputStream.available(); or file.length();

The Transfer-Encoding is not used anymore if Content-Length is
defined :)

-- 
Florian Desbois <fd...@codelutin.com>
SSLL Code Lutin
http://www.codelutin.com
tel : 02 40 50 29 28
Réseau Libre-Entreprise 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Disable Transfer-Encoding chunked from StreamResponse

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
On Thu, 08 Jul 2010 08:34:06 -0300, fdesbois <fd...@codelutin.com>  
wrote:

> Hi,

Hi!

> How can I disable Transfer-Encoding chunked ? I tried to do this in
> the StreamResponse :

I really don't know the answer, but I guess this is related to the server  
configuration, not Tapestry-related.

-- 
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor
Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org