• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Bear Bibeault
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Jj Roberts
  • Tim Holloway
  • Piet Souris
Bartenders:
  • Himai Minh
  • Carey Brown
  • salvin francis

Sessions in JSP

 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How can i be notified that my client has left my page or has closed the explorer window so that i can perform some task before invalidating his session.
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
With a normal structure of user request - server response, you can't tell what the user is doing. If you absolutely have to know when the user has "left" - you could put an invisible applet on the page that keeps up a "heartbeat" of requests - but thats a lot of trouble.
If all you need to do is some upkeep before the servlet engine invalidates the session by timing out, look into the
HttpSessionBindingListener interface
which can be notified when the session is about to be destroyed.
Bill

------------------
author of:
 
Desperado
Posts: 3226
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moid: Please read the username policy of JavaRanch. In particular single name usernames are not permitted. Thanks.
The policy, which must be adhered to, is at
http://www.javaranch.com/ubb/Forum10/HTML/000180.html
Thanks again and welcome to JavaRanch.
---
Sheriff Tony
 
The longest recorded flight time of a chicken is 13 seconds. But that was done without this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic