You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Melonie Brown <me...@yahoo.com> on 2003/05/08 19:09:43 UTC

Custom Validator

I'm attempting to write a custom validator similar to
the example at
http://jakarta.apache.org/struts/userGuide/dev_validator.html.
It shows writing a validation method to compare two
field values but it uses a method that doesn't exist
in the 1.0.2 commons validator -
ValidatorUtil.getActionError(application,             
              request,va,field));

The OnJava article
(http://www.onjava.com/pub/a/onjava/2002/12/11/jakartastruts.html)
uses the deprecated StrutsValidator. 

Can someone point me to a working example of a custom validation?

__________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.
http://search.yahoo.com

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


Re: Custom Validator

Posted by Rob Leland <rl...@apache.org>.
Melonie Brown wrote:

>I'm attempting to write a custom validator similar to
>the example at
>http://jakarta.apache.org/struts/userGuide/dev_validator.html.
>It shows writing a validation method to compare two
>field values but it uses a method that doesn't exist
>in the 1.0.2 commons validator -
>ValidatorUtil.getActionError(application,             
>              request,va,field));
>

This became o.a.s.validator.Resources()

However ValidatorUtil.getActionError() calls 
o.a.s.validator.Resources().getActionError()
so the example should still work.
FYI, I have updated the example to use Recources.getActionError()

>
>The OnJava article
>(http://www.onjava.com/pub/a/onjava/2002/12/11/jakartastruts.html)
>uses the deprecated StrutsValidator. 
>
o.a.s.util.StrutsValidator
became o.a.s.validator.FieldChecks

Again, this should still work since the methods call the correct 
FieldChecks method.

>
>Can someone point me to a working example of a custom validation?
>
>__________________________________
>Do you Yahoo!?
>The New Yahoo! Search - Faster. Easier. Bingo.
>http://search.yahoo.com
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>
>
>  
>



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