>I also have same question. Also i would like to know what are the ways to
>find out in my Servlet "whether the user is still available or not whether he
>has closed the browser/ cancelled the request by pressing the "ESC" key / shut
>down his browser / or he has got disconnected".

There is no concept of a browser closing. Since all http sessions are stateless,
then each time a page is requested then when the browser finishes loading the
page or not, it is the end of the http session.

Unless you check with the server how much of the content has been sent there
is no real way to catch this.

If what you really want is to know if the user is no longer browsing your site
then the timeout of a session can be captured with with the interface
HttpSessionBindingListener, which get called when the session times
out (so, say after 30 minutes of inactivity)

An alternative (but more hassle, and a pain for the user) is to either use the
<body onunload=""> or to write an applet that sends a UDP packet when the
close method is called (although you then have a delay when the page load
and the UPD packet may not get through) ...


--
Subvert the dominant paradigm
 http://www.cyber4.org/members/grumpy/index.html

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to