Results 1 to 2 of 2

Thread: Help with MultiActionController

  1. #1

    Default Help with MultiActionController

    Hi All,

    I am defining a MultiActionController using the PropertiesMethodNameResolver. My requirement is that I call the method when the browser is closed. I have a bunch of session invalidation methods (session.invalidate()). How can I invoke this method upon closing of the browser( click the cross)

  2. #2
    Join Date
    Mar 2007
    Location
    Australia
    Posts
    3

    Default

    You can't do this easily. The browser doesn't send any message to the server when it closes. So the server has no direct way of knowing if someone kills the browser.

    The server has a session timeout, which means that after some inactivity (eg. 30 mins), the session will close. You can set up a sessionListener to listen for such lifecycle events.

    One way to cheat is to have a small iframe or frame, that loads a JSP that refreshes itself (using meta refresh) every 10s or so. Each time the refresh is called, the server should reset a timer. If the timer ever goes, say, 15s without being reset, you might assume that the browser is no longer looking at your page - possibly because it's closed, or maybe because the user is looking elsewhere.

    John.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •