hi, I very hardly trying to disable the close window using servlet code
problem: My servlet code contain logout button if they pressed that button that flag value will change but without pressing logout button directly closing the window i getting problem in that please help me
A couple of reasons why this is not a good thing to try to do:
it annoys users if you stop the normal operation of their browser
there is no 100% full proof way of doing it anyway
Why are you trying to prevent the browser window being closed? There may be another way to achieve what you want your application to do without having to mess with the browser behaviour. [ August 05, 2008: Message edited by: Paul Sturrock ]
Originally posted by saravanan rajendran: hi, thanks for yr reply HttpSessionListener this method can disable the close window please help me how to use this
it can not disable the close window of browser. but while the session invalidate ,this Listener(one of the method sessionDestroyed() of HttpSessionListener) gets call...there you can do your business logic.
if user directly close your window... assign default <session-invalidate>..so when session get invalidate...the HttpSessionListener gets call .