[jboss-user] [JBoss Seam] - DVD Store sample - returns "success".
gersonk
do-not-reply at jboss.com
Wed Sep 19 19:49:29 EDT 2007
I'm trying to understand the 'DVD Store' sample that comes with seam distribution. The EditCustomerAction.saveUser() could return the "success" string, but I can't find its reference in the pages.xml. How does Seam know which page it should forward to?
| public String saveUser() {
| if (!isValidNamePassword()) {
| facesMessages.add("User name #{customer.userName} is not unique");
| return null;
| }
|
| try {
| em.persist(customer);
| sessionContext.set("currentUser", customer);
| Actor.instance().setId(customer.getUserName());
|
| identity.setUsername(customer.getUserName());
| identity.setPassword(customer.getPassword());
| identity.login();
|
| facesMessages.addFromResourceBundle("createCustomerSuccess");
| return "success";
| } catch (InvalidStateException e) {
| InvalidValue[] vals = e.getInvalidValues();
| for (InvalidValue val: vals) {
| facesMessages.add(val);
| }
|
| return null;
| } catch (RuntimeException e) {
| ctx.setRollbackOnly();
|
| facesMessages.addFromResourceBundle("createCustomerError");
|
| return null;
| }
| }
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4086389#4086389
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4086389
More information about the jboss-user
mailing list