struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Greg Lindholm <glindh...@yahoo.com>
Subject Re: [s2] Stream Result - no content length
Date Tue, 09 Sep 2008 15:19:54 GMT


DNewfield wrote:
> 
> If you do not specify the content length in the stream result, your 
> stream will be requested twice (each request is required to provide an 
> independent stream -- a frequent source of bugs for people that don't 
> realize it), one of which will be read through it's entirety just to 
> find the length, the other will be used to actually send out the data.
> 
> -Dale
> 
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 jumped into the debugger and stepped through StreamResult and 
it doesn't appear to be true.    The input stream is requested once and
written to the output stream.

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

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?

-- 
View this message in context: http://www.nabble.com/Stream-Windows-Executable-From-Linux-Machine-tp19331612p19394682.html
Sent from the Struts - User mailing list archive at Nabble.com.


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


Mime
View raw message