5 Replies Latest reply on Mar 20, 2007 7:05 AM by Tony Herstell

    FacesMessage not appearing....

    Tony Herstell Master

      given:

      @Stateless
      @Name("authenticationController")
      public class AuthenticationControllerImpl implements AuthenticationController, Serializable {
      
       @PersistenceContext
       private EntityManager em;
      
       @In(create = true)
       @Out
       private LoggedInUser loggedInUser;
      
       @In(create = true)
       private transient FacesMessages facesMessages;
      
       @Logger
       private Log log;
      
       @In(create=true)
       EncryptionController encryptionController;
      
       public boolean authenticate() {
       boolean valueToBeReturned = false;
       log.info(">authenticate");
       log.info("Starting authentication for " + Identity.instance().getUsername() + ".");
       try {
       User matchedUser = (User) em.createQuery(
       "from User u where u.username = :username")
       .setParameter("username", Identity.instance().getUsername())
       .getSingleResult();
      
       // Found the User.
       log.info("Found User => " + matchedUser);
      
       // Now check the Password
       log.info("Password from Dabase:" + matchedUser.getPassword());
       log.info("Password from Screen:" + Identity.instance().getPassword());
       if ((encryptionController.decrypt(matchedUser.getPassword())).equals(Identity.instance().getPassword())) {
      
       // Add any roles
      /*
       if (matchedUser.getRoles() != null)
       {
       for (UserRole eachUserRole : user.getRoles())
       Identity.instance().addRole(eachUserRole.getName());
       }
      */
       log.info("Success.");
       loggedInUser.logInUser(matchedUser);
       valueToBeReturned = true;
       } else {
       log.info("Failed on Password Check.");
       facesMessages.addFromResourceBundle("loginAttempt", "login_error_password_incorrect");
       }
       } catch (NoResultException nre) {
       // Failure
       log.info("Failed on Username Check.");
       facesMessages.addFromResourceBundle("loginAttempt", "login_error_user_unknown");
       }
       log.info("<authenticate");
       return valueToBeReturned;
       }
      }
      
      

      when the username fails I get the request to add the message "login_error_user_unknown" added to some task thing inside Seam code.

      I never get to see the message on the screen.

      Where do I go to see what happens in the task thing.

      This used to work and now doesn't... and I havent changed it.

      Now on Seam 1.2.0 Patch 1 and IceFaces 1.0.6 DR#1

      The xhtml the message is getting pushed into:
      <ice:panelGrid columns="2" rendered="#{!(identity.loggedIn) and !(loggedInUser.currentlyRegistering)}" >
       <ice:commandButton id="loginAttempt" type="submit" value="#{messages.button_login}" action="#{identity.login}">
       <s:conversationPropagation type="none"/>
       </ice:commandButton>
       <s:button type="submit" value="#{messages.button_register}" immediate="true" action="#{userRegistrationController.startRegistration}">
       <s:conversationPropagation type="none"/>
       </s:button>
      </ice:panelGrid>
      



      Any ideas?