3 Replies Latest reply on Jul 24, 2012 10:23 AM by atarifreak73

    Session Expiration Handling

    atarifreak73 Newbie



      I have a problem with handling for session timeouts by ajax.

      I have readed chapter 5.6. "Error handling" and have put the following entries in my web.xml to use A4J in Javascript:





      It dont works. Then I have write additional this to web.xml:




      It dont also works. When I use the A4J-Object (A4J.AJAX.onExpired) in Javascript for errormessaging, I become from firebug the message "ReferenceError: A4J is not defined":



      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE html
              PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
      <html xmlns="http://www.w3.org/1999/xhtml"
            xml:lang="en" lang="en"
              <script type="text/javascript">
                  A4J.AJAX.onExpired = function(loc, expiredMsg)
                      if (window.confirm("Ihre Sitzung abgelaufen: Beim Klick auf OK wird eine neue Sitzung gestartet!"))
                          return '#{facesContext.externalContext.requestContextPath}/index.html';
                          return false;


      I use RF 4.2 and JSF 2.0.9.


      What is my error in reasoning?

      Thank You!