struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Finney" <fin...@ACM.org>
Subject adding a content-length header
Date Mon, 02 Mar 2009 02:48:37 GMT
Hi,

Hypothetically: Let's say I am working with a server that does not always
send a HTTP response with a content-length header or a Transfer-Encoding of
chunked (with all the required other stuff set). 

The following thought came to mind: Shouldn't there be a way to get the
length of the content I am sending back? I could just add the header
content-length to the response if content-length and Transfer-Encoding
headers are both missing from the HttpServletResponse. 

Could I create my own Result by subclassing 
the Dispatcher Result, and somehow get access to the length of the content
which has been rendered? 

I could create an interceptor that after the invoke() I get the
HttpServletResponse. The question remains: How can I get access to the
content length of the content which has been rendered?

Thanks.

-- 
Michael Finney - "Always Striving To Serve You Better Every Day"
finney@ACM.org
http://www.SmilingSoftwareSolutions.com



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message