You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Billy Ng <kw...@earthlink.net> on 2002/10/10 19:43:59 UTC

help on validate attribute

Hi folks,

If I put validate=true in the action tag, the form will be validated once it is load.  Is it a right behavior?  Since there is no data in the form bean, some madatory fields that I specify in the validate method will be treated as error.  How should I handle it?

Billy Ng

Re: help on validate attribute

Posted by Antoni Reus <an...@wanadoo.es>.
Hi,

A Dijous 10 Octubre 2002 19:43, Billy Ng va escriure:
> Hi folks,
>
> If I put validate=true in the action tag, the form will be validated once
> it is load.  Is it a right behavior?  Since there is no data in the form
> bean, some madatory fields that I specify in the validate method will be
> treated as error.  How should I handle it?
>
> Billy Ng

If you put validate="true" in a action-mapping the form will be populated and 
then validated before the perform (now execute) method of the action is 
called.

validate="true" should be used in the action that "receives" the post, not the 
action that generates the html form!


Salut,

-- Antoni Reus


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>