[jboss-user] [JBoss Seam] - FacesMessage enqueued, but not displayed.

tonylmai do-not-reply at jboss.com
Fri Sep 7 12:56:31 EDT 2007


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:

anonymous wrote : 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.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4082242#4082242

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4082242

More information about the jboss-user mailing list