commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Graham <>
Subject Re: [Validator] trouble using validator standalone
Date Mon, 20 Sep 2004 19:37:36 GMT
Validator comes with 2 primary features:  A pluggable validation framework
and basic validation methods that you can choose to use in the framework. 
GenericValidator is the second feature.  

Currently, you need to wrap the provided validation methods with a method
that is invoked by the framework.  Struts' FieldChecks class wraps
GenericValidator methods for its usage and the example standalone
validator class also wraps some methods.  You need to do something similar
if you're using validator without Struts.

The wrapping requirement is a leftover from the old design and there has
been talk of removing that step altogether by making versions of
GenericValidator methods that are directly callable from the framework.


--- Ricardo Trindade <> wrote:

> Hi,
> 	I' having troubles using commons-validator (latest release, also tried
> today's snapshot) without struts.
> 	Specifically I tried the code in CVS that can be reached through the
> item :
> 	I couldn't understand why this examples uses Validators from the test
> package, instead of using, for example, GenericValidator. I tried to
> change
> the example to use GenericValidator, but validating my bean always
> fails.
> 	My XML (header removed):
> <form-validation>
> 	<global>
> 		<validator name="inteiros"
> classname="org.apache.commons.validator.GenericValidator" method="isInt"
> methodParams="java.lang.String" msg=""/>
> 	</global>
> 	<formset>
> 		<form name="ValidateBean">
> 			<field property="firstName" depends="inteiros"/>
> 		</form>
> 	</formset>
> </form-validation>
> thanks
> Ricardo Trindade
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

Do you Yahoo!?
Declare Yourself - Register online to vote today!

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message