I assume you are talking about a long running query, during which
the user might stop the request, not an open session.

   The only way to tell is to return content to the browser in hopes
that the connection will abort.  This can be defeated by caching on the
server side, but by flushing the stream, the content is usually
delivered.  If you have a very long running request, I suggest you run
the request in some type of batch mechanism, and return a "running
request" page to the user.  Then have a link that will deliver the
content when it becomes available.

   Look through the archives if you have more questions, this has got
to be on the top 10 list of posted questions at this point.

ROLDAN, Gabriel raul wrote:

Hi, is there any way of knowing from a servlet if the client
connection that have thrown the request is still alive? this is
for avoid executing resource-expensive server tasks if the user has
just gone, or he reloads the page a lot of times without waiting...

thanks


Gabriel Roldán
GIS Research and Development
Dominion T.I.
[EMAIL PROTECTED]

=========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".

Some relevant archives, FAQs and Forums on JSPs can be found at:

http://java.sun.com/products/jsp
http://archives.java.sun.com/jsp-interest.html
http://forums.java.sun.com
http://www.jspinsider.com


===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".

Some relevant archives, FAQs and Forums on JSPs can be found at:

http://java.sun.com/products/jsp
http://archives.java.sun.com/jsp-interest.html
http://forums.java.sun.com
http://www.jspinsider.com

Reply via email to