2 Replies Latest reply on Oct 15, 2008 3:03 PM by Fernando Franzini

    Redirect on session expiration

    Jiri Pejchal Newbie


      I would like to redirect user to an error page on session expiration.
      In the documentation I have found the following:

      It's possible to redefine also the "onExpired" framework method that is called on the "Session Expiration" event.

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

      Here the function receives in params:
      * loc - URL of the current page (on demand can be updated)
      * expiredMsg - a default message on "Session Expiration" event.

      How do I redefine the onExpired method?
      I'm using myfaces and facelets and when I set session-timeout in web.xml usually get ViewExpiredException.

      So in javascript it would be something like document.location.href='sessionExpired.faces'

      What about defining a filter in web.xml that would check for session validity and would do redirect?