struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gareth Meyrick" <gar...@kirkstonepass.com>
Subject Re: Help Validating Accepted/Not Accepted radio buttons
Date Thu, 02 Dec 2004 23:13:53 GMT
hi,

Wendy Smoak wrote:
> 
> From: "Jeff Beal" <jbeal@webmedx.com>
> > 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 {
       ActionMessages errors = new ActionMessages();
       errors.add(ActionMessages.GLOBAL_MESSAGE,
         new ActionMessage(Constants.ACCEPT_TERMS_ERROR));
       saveErrors(req,errors);
> >    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.

where Constants.ACCEPT_TERMS_ERROR is a key in the message properties file
should work.

-gm

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message