A compression filter does exactly that, that's the reason it occurred to me :) I remember facing *precisely* that problem a few months back with the JWP sample app. I know I solved it, but I guess I had forgotten the root cause :)

Frank

Craig McClanahan wrote:
On 1/23/06, Frank W. Zammetti <[EMAIL PROTECTED]> wrote:
Craig McClanahan wrote:

[snip]

Calling flush() doesn't necessarily cause the *entire* response to be
sent, because you might still be creating more output.  But it *does*
cause the HTTP headers, and any output content you've written to be
transmitted.  From the perspective of the servlet API, this response
has now been "committed" so you cannot later decide to do a redirect
or forward.

In general, the only use case I can think of for calling flush()
yourself is if you have something like a "Request In Progress - Please
Wait" at the beginning of your page, and you want that to show to the
user while a time-consuming process is performed to create the
remainder of the content.
Interesting... I would have thought just the opposite, but this makes
sense.  I suppose one could imagine a problem with a filter that does
some post-processing occurring if you flush() yourself.


Yah, I suppose that's a potential use case, but I've never needed it.

By the way, you also have control over how much output content is
buffered before the container commits the response even if it's not
done yet ... see methods like getBufferSize() and setBufferSize() on
ServletResponse.  You can also ask if the response has indeed been
committed yet.

So, leave flushing to the next guy, contrary to what everyday etiquette
would seem to indicate ;) LOL

Struts doesn't but the servlet container will, once your processing
has finished.
This is a guarantee of the servlet API I would assume?  It seems like it
logically would be, but I wasn't sure.

Section SRV.5.5 of the servlet spec :-).

Craig
Frank


Craig

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





--
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com
AIM: fzammetti
Yahoo: fzammetti
MSN: [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to