| Author |
Delete Records When user clicks close button of a browser
|
Nithish Yalamanchili
Greenhorn
Joined: Aug 16, 2007
Posts: 24
|
|
In my jsp page there is no logoff/signout button. But when user logins some data is stored in table. I want to delete that data when user closes browser directly by clicking close button of browser. Nithish
|
 |
Bosun Bello
Ranch Hand
Joined: Nov 06, 2000
Posts: 1506
|
|
|
There is no direct way to capture that event on the backend. What if the browser crashes or the user never closes the browser?
|
Bosun (SCJP, SCWCD)
So much trouble in the world -- Bob Marley
|
 |
Ben Souther
Sheriff
Joined: Dec 11, 2004
Posts: 13410
|
|
What do have are session listeners which will fire events when the session is created or destroyed. From your perspective, you shouldn't care why the session ends, you only care that the resources are cleaned up when it does. See: http://java.sun.com/j2ee/1.4/docs/api/javax/servlet/http/HttpSessionListener.html
|
Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
|
 |
 |
|
|
subject: Delete Records When user clicks close button of a browser
|
|
|