0 Replies Latest reply on Aug 28, 2007 3:27 AM by chen hong

    is it rich:menuItem bug ?

    chen hong Newbie

      my menu source code:
      <rich:menuItem submitMode="ajax" value="update" action="/UserEdit.xhtml">
      <f:param name="userId"
      value="#{authenticator.user.id}"/>
      </rich:menuItem>

      the Authenticator class:

      @Name("authenticator")
      @Scope(ScopeType.SESSION)
      public class Authenticator {
      @Logger
      Log log;
      @In
      Identity identity;
      @In
      EntityManager entityManager;

      private User user = new User();

      public boolean authenticate() {
      log.info("authenticating #0", identity.getUsername());
      // write your authentication logic here,
      // return true if the authentication was
      // successful, false otherwise
      try {
      user = (User) entityManager
      .createQuery(
      "from User where username = :username and password = :password")
      .setParameter("username", identity.getUsername())
      .setParameter("password", identity.getPassword())
      .getSingleResult();
      if (user.getUserRoles() != null) {
      for (UserRole role : user.getUserRoles()) {
      identity.addRole(role.getRole().getName());
      }
      }
      return true;
      } catch (NoResultException ex) {
      return false;
      }

      }

      @Out
      public User getUser() {
      return user;
      }
      }


      i login to the home page ,then drop the menu update,the url is manhour/UserEdit.seam?cid=37
      but the edit page has no the user info,but when i drop the menu update again,the url is manhour/UserEdit.seam?userId=1&cid=38,here the user info appear,i can't understant that.

      can you help me?