I'm having trouble understanding how ActionSupport works. I've extended
ActionSupport to handle a form page. If the from contains errors (ie: i
have an amount field mapped like s:text name=invoice.amount/ and the
user types in asdf) the action mapped to result type execute is
never called and,
Add something like this to your action
public void validate() {
User user = getUser();
if (StringUtils.isBlank(user.getName())) {
addActionError(getText(user.name.empty));
}
if (StringUtils.isBlank(user.getAddress())) {
addActionError(getText(user.address.empty));
}
}
Have a
Thank you, it's just what i needed
David Harland wrote:
Add something like this to your action
public void validate() {
User user = getUser();
if (StringUtils.isBlank(user.getName())) {
addActionError(getText(user.name.empty));
}
if (StringUtils.isBlank(user.getAddress())) {
3 matches
Mail list logo