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 look at
http://today.java.net/pub/a/today/2006/01/19/webwork-validation.html
--- Eugen Stoianovici <[EMAIL PROTECTED]>
wrote:
> 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, even though the form si set to not
> perform validation.
>
> I want to handle errors trough code (rather than
> providing an xml for
> it). What do i need to override to handle this type
> or errors?
>
> --
> Regards,
> Eugen Stoianovici
>
>
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
>
>
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]