From: "Donie Kelly" <[EMAIL PROTECTED]>
> I have a form that uses the standard form validation based on the
> validation.xml file. It all works fine except for when I'm pre-populating
> the form on first showing. The validation is kicking in before the data is
> retrieved from the database.
In the Form class, I have:
public ActionErrors validate( ActionMapping mapping, HttpServletRequest
request ) {
ActionErrors errors = new ActionErrors();
if ( "POST".equals( request.getMethod() ) ) {
log.debug( "User has submitted the form, validating..." );
errors = super.validate( mapping, request ); }
return errors; }
That stops the validation from happening unless the user has actually
submitted the form. I suppose you'd have to deal with someone constructing
a URL and doing a GET, but since mine are intranet apps and require a login,
if anyone tries it I'll know who it is and can go whack their hand with a
ruler.
--
Wendy Smoak
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]