1 Reply Latest reply on Nov 9, 2005 5:23 PM by Rene Lavoie

    Query parameter

    Rene Lavoie Newbie

      Re-using your code, I you would use the @Create annotation instead of calling the init method in my xhtml page such as:


      @Create
      private void initUser(String username)
      {
      use = (User) em.createQuery("from User u where u.username = :username")
      .setParameter("username", username)
      .getSingleResult();
      log.info("username "+use.getUsername());
      }


      Then, in your xhtml file, you would access the user from the action class such as :
      <h:outputText value="#{websiteGenerator.use.username}" />