Uploaded image for project: 'JBoss Enterprise Application Platform 4 and 5'
  1. JBoss Enterprise Application Platform 4 and 5
  2. JBPAPP-6872

The faces message defined in the seam exception handler for ViewExpiredException is not displayed against ajax request

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Do
    • Icon: Minor Minor
    • EAP_EWP 5.3.0.GA
    • EAP_EWP 5.1.0
    • RichFaces, Seam2
    • None
    • EAP 5.1.0, Seam 2.2.2.EAP5, Richfaces 3.3.1.SP2

    • Hide

      Steps to reproduce:
      1. deploy the attached web application 'myproject.war'
      2. access to the web application http://localhost:8080/myproject/test.seam
      3. login with the username 'admin' and a blank password
      4. wait one minute for triggering a session timeout
      5. click the button 'Invoke testAction.testAction() by a4j:commandButton'
      6. the faces message 'Your session has timed out, please try again' is not displayed in the error page

      Show
      Steps to reproduce: 1. deploy the attached web application 'myproject.war' 2. access to the web application http://localhost:8080/myproject/test.seam 3. login with the username 'admin' and a blank password 4. wait one minute for triggering a session timeout 5. click the button 'Invoke testAction.testAction() by a4j:commandButton' 6. the faces message 'Your session has timed out, please try again' is not displayed in the error page
    • Hide

      lfryc pointed out the following solution for client-side error handling in the RichFaces 3 guide:

      A4J.AJAX.onExpired = function(loc, expiredMsg){
          if(window.confirm("Custom onExpired handler "+expiredMsg+" for a location: "+loc)){
            return loc;
          } else {
           return false;
          }
      }
      

      http://docs.jboss.org/richfaces/latest_3_3_X/en/devguide/html/ArchitectureOverview.html#SessionExpiredHandling

      Show
      lfryc pointed out the following solution for client-side error handling in the RichFaces 3 guide: A4J.AJAX.onExpired = function(loc, expiredMsg){ if (window.confirm( "Custom onExpired handler " +expiredMsg+ " for a location: " +loc)){ return loc; } else { return false ; } } http://docs.jboss.org/richfaces/latest_3_3_X/en/devguide/html/ArchitectureOverview.html#SessionExpiredHandling
    • Hide
      CAUSE
      if session time-out happens and an application uses redirection to error page catching ViewExpiredException, succesive ajax action doesn't take the Faces message about session expiration.
      CONSEQUENCE
      User won't know about expired session from Error page content.
      FIX
      Add the javascript handler to your error page provided in Workaround field.
      RESULT
      Error page should show the Faces message correctly.
      Show
      CAUSE if session time-out happens and an application uses redirection to error page catching ViewExpiredException, succesive ajax action doesn't take the Faces message about session expiration. CONSEQUENCE User won't know about expired session from Error page content. FIX Add the javascript handler to your error page provided in Workaround field. RESULT Error page should show the Faces message correctly.
    • Not Yet Documented
    • NEW

      The following exception handler is defined in the pages.xml:

       
          <exception class="javax.faces.application.ViewExpiredException">
              <redirect view-id="/error.xhtml">
                  <message severity="warn">Your session has timed out, please try again</message>
              </redirect>
          </exception>
      

      Then seam handles javax.faces.application.ViewExpiredException and redirects to the error.xhtml after a session timeout happens.

      The page redirection works fine. And the faces message "Your session has timed out, please try again" is shown correctly when ViewExpiredException is triggered by normal http request like <h:commandButton>.

      But the faces message is not displayed when ViewExpiredException is triggered by ajax request like <a4j:commandButton>.

              bleathem@redhat.com Brian Leathem (Inactive)
              rhn-support-mmiura Masafumi Miura
              Eva Kopalova Eva Kopalova (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: