[jboss-user] [JBoss Seam] - Action method + outcome

kabal do-not-reply at jboss.com
Tue Dec 4 21:28:16 EST 2007


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;
  |       }
  |    }
  | 

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

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



More information about the jboss-user mailing list