Christopher Schultz wrote:
This was already pointed out (by me, in fact). Sometimes, you can trick
the browser into keeping the connection open by sending data back little
by little. For instance, I think you might be able to keep the
connection open by sending HTML comments like "<!-- still processing
request -->" every so often. I've never tried it, but it might work.

This does work, but there is a limit to how long you can keep the connection open. I have a report which outputs a line in the html table every 5 seconds, from the users perspective it seems more responsive because they start seeing things straight away, but after about 30 seconds the browser closes the connection. (I don't know the exact times but IE keeps the connection open shorter than firefox).

The best strategy for long-running requests is to have the
background-processing occur in a separate thread and have the user's
browser make regular requests to see if processing is complete. This
solves the session timeout problem (just have the browser re-request the
"update" page every 60 seconds or so and the session won't time out) and
the browser timeout problem (since you aren't waiting for 10 minutes for
data to come back).
Yes this is the best way!

Best Regards,
Jacob

_________________________________________________
Jacob Rhoden -- http://www.jacobrhoden.com/



---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to