0 Replies Latest reply on Sep 7, 2007 12:56 PM by tonylmai

    FacesMessage enqueued, but not displayed.

      Hello,

      I have a simple login page and an Authenticator all based on code generated with Seam-gen. They used to work. And now I don't know which code I modified that resulted me with this problem.

      When the Authenticator caught an AuthenticationException, it would write to FacesMessage like the following:

      try {
       long sessionId = clientMgr.login(identity.getUsername(), identity.getPassword());
      ...
       } catch (AuthenticationException e) {
       switch (e.getRejectReason()) {
       case USER_CREDENTIAL_NOT_FOUND: {
       facesMessages.add("#{messages['login.failed.UserCredentialNotFound']}");
       break;
       }
       case USER_CREDENTIAL_UNMATCHED: {
       FacesMessages.instance().add("#{messages['login.failed.UserCredentialNotMatch']}");
       break;
       }
      


      And on my login page, I have the following:

      <div class="body">
       <h:form id="login">
       <rich:spacer height="10" />
       <a4j:outputPanel id="loginPanel">
       <rich:panel>
       <f:facet name="header">#{messages['login.logon.legend']}</f:facet>
       <div class="dialog" align="center">
       <h:panelGrid>
       <h:messages styleClass="message" />
       </h:panelGrid>
      


      Yet when I tried to login with invalid username/password, I got no error message displayed on the page and the following warning in the log:

      09:46:56,968 INFO [lifecycle] WARNING: FacesMessage(s) have been enqueued, but may not have been displayed.


      How does Seam decide when to display or not to display an enqueued FaceMessage?

      Thanks for your help.
      -tony