You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by robin bajaj <ro...@gmail.com> on 2006/11/23 20:52:14 UTC

how to use validation rules from validatior-rules.xml in Struts Actions

Hi Folks,
I have an Email text field that I want to validate against Struts
validation framework's provided "email" Rule in validator-rules.xml.

Can I do this programmatically in Struts Action or ActionForm's java 
code instead of
having to declaratively do it in validation.xml. ??


Any help would be much appreciated,
robin.

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


Re: how to use validation rules from validatior-rules.xml in Struts Actions

Posted by Java Programmer <jp...@gmail.com>.
On 11/23/06, robin bajaj <ro...@gmail.com> wrote:
> Hi Folks,
> I have an Email text field that I want to validate against Struts
> validation framework's provided "email" Rule in validator-rules.xml.
>
> Can I do this programmatically in Struts Action or ActionForm's java
> code instead of
> having to declaratively do it in validation.xml. ??
You can implement validate() method in ActionForm class, and use
EmailValidator class part of commons-validator package, as the Struts
use it.

Regards,
Adr

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