Java Reference
In-Depth Information
Once the user has filled in the fields and clicked the Continue button,
the register ( ) event handler decides on the next page:
Download email_19/src/stripesbook/action/RegisterActionBean.java
private static final String ALIASES = "/WEB-INF/jsp/aliases.jsp";
private static final String DONE = "/WEB-INF/jsp/reg_complete.jsp";
public Resolution register() {
if (numberOfAliases > 0) {
return new ForwardResolution(ALIASES);
}
return save();
}
public Resolution save() {
userDao.save(user);
return new RedirectResolution(getClass(), "done");
}
@DontValidate
public Resolution done() {
return new ForwardResolution(DONE);
}
@DontValidate
public Resolution cancel() {
return new RedirectResolution(LoginActionBean. class );
}
If the user has chosen to have one or more aliases, the action bean
forwards to aliases.jsp , which displays the form for the user to fill out
the aliases:
Download email_19/web/WEB-INF/jsp/aliases.jsp
<p> Enter your email aliases: </p>
<s:form beanclass="stripesbook.action.RegisterActionBean">
<s:errors/>
<table class="form">
<c:forEach begin="0" end="${actionBean.numberOfAliases - 1}"
var="index">
<tr>
<td>
<s:label for="user.aliases[${index}]"/> ${index + 1}:
</td>
<td><s:text name="user.aliases[${index}]"/></td>
<td> @stripesbook.org </td>
</tr>
</c:forEach>
<tr>
<td></td>
<td>
<s:submit name="save" value="Continue"/>
<s:submit name="cancel" value="Cancel"/>
</td>
 
Search WWH ::




Custom Search