tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Filip Hanik - Dev Lists <>
Subject Re: Trailer header and tomcat
Date Wed, 05 Aug 2009 21:37:44 GMT
On 08/05/2009 02:14 PM, Keyur Shah wrote:
> Tomcat by default sends chunked responses =>  Transfer-Encoding:chunked
> I'm calculating the ETag for the response dynamically as the content is
> being
> written to the response stream. Since I'll know the final value of the ETag
> only
> when the stream is closed, I indicate that using the Trailer header =>
> Trailer:
> ETag
> I'm ensuring that just before the stream is closed, I set the ETag header =>
> ETag: SomeETagValue
> However, when I look at the response on the client, the ETag header was
> never
> written.
> Is this a tomcat specific bug or am I doing something wrong?
When you write, after you have filled up the buffer, tomcat will commit 
the response.
You will need to not write any of your response until you have the tag, 
so buffer your response,
calculate your tag, set the header, write the response

> Thanks,
> Keyur

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message