2 Replies Latest reply on Dec 26, 2007 6:10 PM by Pete Muir

    Action method + outcome

    Brett Haas Newbie

      Typically the outcome of an "Action Method" is definite in either faces-config.xml or navigation.xml.

      What if you want the outcome to be an actually .XHTML URI, instead of a String constant that refers to an view definite in the configuration file?

      For instance (code from Seam tutorial)

      public String register() (5)
       {
       List existing = em.createQuery(
       "select username from User where username=#{user.username}") (6)
       .getResultList();
      
       if (existing.size()==0)
       {
       em.persist(user);
       log.info("Registered new user #{user.username}"); (7)
       return "/registered.xhtml"; (8)
       }
       else
       {
       FacesMessages.instance().add("User #{user.username} already exists"); (9)
       return null;
       }
       }