2 Replies Latest reply on Oct 31, 2007 9:21 AM by marc1

    session timeout and A4J.AJAX.onExpired

    marc1

      hi, the documentation mentions

      A4J.AJAX.onExpired = function(loc,expiredMsg){
      // Custom Developer Code
      };
      


      but i dont have a clue on how to use it. basically, i want to redirect to some login page when the session has expried or when some other error has ocurred, insteda of getting the current facelets trace stack on the browser.

      marcelo

        • 1. Re: session timeout and A4J.AJAX.onExpired

          if you send a non-jsf request (to the login page), the new session is established. I am not sure what are your doubts.

          • 2. Re: session timeout and A4J.AJAX.onExpired
            marc1

            yes, lets assume i have pageone.xhtml open on my browser and go to lunch. when i came back the session has expired for sure:-). if i continue working on that same page i get as expected a stack trace on the screen. i would like to redirect in a controlled way to a login page or to some other page.

            im thinking about some kind of error handler or similar that allows me to gain control and redirect to an error page.

            (of course, in a typical scenario a servlet filter would be monitoring the session state and do the redirection at that stage - but i was wondering of a way to do it at a later time, ie. when facelets or richfaces are in control).

            i thought that was the purpose of A4J.AJAX.onExpired - if yes, is there some sample a can look at ?

            thanks! marcelo