2 Replies Latest reply on Jan 24, 2008 11:14 AM by Pete Muir

    Faces messages not displaying on redirected page

    Terry Apprentice

      faces messages added in observer method for Identity events do not display on redirected (error) page???
      but display fine on page which initiated the request (login page in this case).

      Seam 2.0.1.CR1

      login.page.xml
      -----------------
      <page conversation-required="false">
      ...
       <navigation from-action="#{identity.login}">
      
       <rule if="#{not identity.loggedIn and orgUserAuthenticate.systemError}">
       <redirect view-id="/error.xhtml"/> <--- messages not display on this redirected page.
       </rule>
       </navigation>
      ...
      </page>
      
      -----------------------------------------
      @Name("orgUserAuthenticate")
      public class OrgUserAuthenticate {
      
      ....
      
      @Observer(Identity.EVENT_LOGIN_SUCCESSFUL)
      public void loginSuccessful() {
      
       //if (orgUserService.setLoginSuccessParams(organisationUser, this)) {
       if (orgUserService.setLoginSuccessParams(organisationUser)) {
      
       orgUserAuthenticated.setUser(organisationUser);
      
       try {
       activityLog.logOrgUser(organisationUser, ActivityLogger.Code.LOGIN_SUCCESSFUL);
       } catch (ActivityLoggerException e) {
      
       identity.logout();
       this.isSystemError = true;
       FacesMessages.instance().getCurrentMessages().clear();
       FacesMessages.instance().addFromResourceBundle(FacesMessage.SEVERITY_ERROR, "au.edu.tisc.SystemErrorWhileLoggingIn", e.getMessage());
       }
      
       } else {
       identity.logout();
       this.isSystemError = true;
       FacesMessages.instance().addFromResourceBundle(FacesMessage.SEVERITY_ERROR, "au.edu.tisc.SystemErrorWhileLoggingIn", "Unable to set user login success parameters.");
       }
      }