struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dale Newfield <>
Subject Re: [struts] [s2] Stream Result - no content length
Date Tue, 09 Sep 2008 17:54:51 GMT
Greg Lindholm wrote:
> Your statement caused me to panic as my code was not prepared to 
> return multiple independent streams and I'm not setting Content Length.

I swear I didn't make this up, as I clearly recall fighting these bugs 
myself...but you're right, as I cannot currently put my finger on the 
code that does this...(and it's not in StreamResult, where you and I 
both expected to find it, even looking back in the webwork revision 
history, so maybe we're looking in the wrong place?).

In case it's there and I'm just failing to find it, or in case this 
changes (back again?) in the future, is there any reason not to put your 
"new FileInputStream(...)" call in the action getter that returns the 

> Are you referring to something else? Please clarify. (A link to a reference 
> would also be nice.)

I wish I could.  I will stop providing this advice until I (re)find it's 

> On a related note, I'm downloading a file and I'm using a FileInputStream 
> for my input stream.  Can I set the Content Length using File.length()? 
> Or is there some munging that occurs to change the content length?

File.length() is the correct return value, and it can only help to 
specify it when known beforehand.


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

View raw message