3 Replies Latest reply on Jan 20, 2012 11:38 AM by Michael G

    Redirecting on Session Expiration in RF 4

    Michael G Novice

      Hello,

       

      I trying to add session expiration handling such that when it happens it would redirect to another page that would let the user know the session has expired and to click on a button which would take them back to the page, basically reloading it.

       

      I'm having problems setting this up.  I've followed what was outline in the dev guide here http://docs.jboss.org/richfaces/latest_3_3_X/en/devguide/html/ArchitectureOverview.html#RequestErrorsAndSessionExpirationHandling but that isn't working for me.

       

      I know my session has expired because in my datatable - collapsiblesubtable i have this as a column.

       

       

       

      and when the session has expired the setProperyActionListener sets the editTask no longer prints any logs.

       

      The issue is that the page no longer can access any of my beans and only client side processing occurs.  I would like instead that the page gets redirected to another page that notifies that user that that session has expired to i can have them click a button to reload the page.

       

      How can i set this up in RF4?

       

      Thanks

        • 1. Re: Redirecting on Session Expiration in RF 4
          Michael G Novice

          It looks like i can keep the session alive if i create a servlet and make a call to it.

           

          But once the session expires i lose my beans which is expected but when i call my servlet i don't get the javax.faces.application.ViewExpiredException and the page doesn't forward.

           

          I have this in the web.xml

           

              <error-page>

                  <exception-type>javax.faces.application.ViewExpiredException</exception-type>

                  <location>/pages/SessionExpired.xhtml</location>

              </error-page>

           

          But not sure why it isn't working, anyone know what i might be doing wrong.

           

          Thanks

          • 2. Re: Redirecting on Session Expiration in RF 4
            Lukáš Fryč Master

            Michael,

             

            I know this is not answer to your question, but

            you could use a4j:poll to keep the session open by the time page is open.

            When using reasonable polling interval, then your server won't get overwhelmed.

            • 3. Re: Redirecting on Session Expiration in RF 4
              Michael G Novice

              Since i could not figure out why using

                   <error-page>

                      <exception-type>javax.faces.application.ViewExpiredException</exception-type>

                      <location>/pages/SessionExpired.xhtml</location>

                  </error-page>

               

              doesn't work for me i decided to go down the path of using jquery IdleTimeout plugin.  So i set up the web xml to have the session timeout and use the jquery plugin to show the notification and perform the redirect for me.

              1 of 1 people found this helpful