2 Replies Latest reply on Aug 12, 2009 2:47 PM by mailtovaithy

    jboss security

      Hi i want to fire an @observer event while the user accidently close the browser or the user not properly logged out from a seam application., i have put user into ApplicationContext() but i dont know how to remove from the contexts., can any one help me urgent!

        • 1. Re: jboss security
          barakka

          Hi,


          if you want to do that as soon as the user accidentally closes the browser (or navigates away from the site) that's impossible. If a short delay is acceptable the solution is a little complex and might be resource intensive but doable. If a long delay (i.e. session expiration) is acceptable than it is easier.


          The first case is impossible 'cos the user is not communicating with the server when he closes the browser ;-)


          The second case, involves polling the server with a keep alive message every x1 seconds and having an asynch component on the server that each x2 (greater than x1) seconds checks if there are any dead users and removes them. But it's a lot of work, and you are getting a request every x1 seconds for each user.


          The third case is easier, but is related to the session timeout which, with some help, you can listen to (org.jboss.seam.preDestroyContext.SESSION event does the trick, almost).


          Hopes it helps and good luck.
          R.

          • 2. Re: jboss security

            Hi i have tried this observer (org.jboss.seam.preDestroyContext.SESSION) but i will automatically called when i run my application can you explain how the configuration in components.xml look like?
            help me sir