struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Wendy Smoak <>
Subject Re: Help Validating Accepted/Not Accepted radio buttons
Date Thu, 02 Dec 2004 22:41:43 GMT
From: "Jeff Beal" <>
> I'd just put that in the Action class instead of in validation.  It
> seems like more of a "business" decision than a "validation" decision.
> (After all, 'Y' and 'N' are both valid responses.)
> In Action:
> if ("Y".equals(myForm.getAccept)) {
>    return mapping.findForward("accept")
> } else {
>    return mapping.getInputForward();
> }

It's not that simple... something about creating an ActionError and putting
it somewhere so it will magically make the message appear on the page when I
forward back to the input form.  I used to know how to do it, but then
things changed.  And that's why I want to use Validator.

From: "Jim Barrows" <>
>Two ways:
> 1) with a mask, where the mask is "Y" or "Yy"

> 2) validWhen, which I *think* goes something like this:

The problem with both of these is that they just ask for <arg0> which is
generally the field label, and then complain that the 'field is invalid' or
(strangely) 'field is required'.  (validWhen is using 'error.required'.)

So I'm down to creating a custom "rule" copying validWhen but giving it a
different message, or just doing it manually in the Action, in which case I
think the info here will help:

Wendy Smoak

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message