5 Replies Latest reply on May 13, 2011 8:44 AM by Ivaylo Petrov

    A4J.AJAX.onExpired Does Not Work

    davesquire Newbie

      I have an application that works great with RichFaces AJAX components, until the session expires on the server.  If the session is expired, then the AJAX calls were causing errors.

       

      So I found info in the help about handling session expiration on the client.  I added this to my web.xml:

      {code}

          <context-param>

              <param-name>org.ajax4jsf.handleViewExpiredOnClient</param-name>

              <param-value>true</param-value>

          </context-param>

      {code}

       

      Then on my page where the AJAX is happening I added the following to a <script> tag in the <head> tag of the page:

      {code}

                      A4J.AJAX.onExpired = function(loc,expiredMsg) {

                          window.location.href = "http://www.google.com";

                      };

      {code}

       

      I was expecting the browser to redirect to Google when an AJAX control was activated after the session was timed out.  BUT, on IE 8 it takes me to my login page (I'm using form based autorization) and it displays two errors saying "Object expected."  If I try to log in, then IE displays this:

      {code:xml}

      <?xml version="1.0" encoding="UTF-8" ?>

        <html xmlns="http://www.w3.org/1999/xhtml">

          <head>

            <meta name="Ajax-Response" content="true" />

            <meta name="Ajax-Expired" content="View state could't be restored - reload page ?" />

          </head>

        </html>

      {code}

       

      In a totally simple application I get the correct behavior (with no username or password required).

       

      I have no idea what could be going wrong.  Any help or ideas as to what I should be looking for or testing would be wonderful!

       

      Thank you so much!