commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Niall Pemberton <>
Subject Re: [validator] Trouble using global constants in variable values
Date Thu, 11 Feb 2010 00:21:31 GMT
On Wed, Feb 10, 2010 at 11:46 PM, Christopher Schultz
<> wrote:
> Hash: SHA1
> All,
> On 2/10/2010 6:27 PM, Christopher Schultz wrote:
>> <constant-value>^.*(([0-9]+.*\p{L}+)|(\p{L}+.*[0-9]+)).*$</constant-value>
> Okay, something must be wrong with my regular expression, or now I'm
> expressing it in the XML, because when I set it to
>  <constant-value>^[a]+$</constant-value>
> will allow me to enter a series of a's and validator will succeed.

You could try testing you're expression directly using
GenericValidator.matchRegexp() until you're happy it works.

If it seems correct, but still doesn't seem to work in your Struts app
then perhaps you could write a Struts plugin to retrieve the validator
resources and display the values for the forms/fields/arguments:

> If the use of the <constant> documented anywhere? I couldn't find
> anything on the website, in the wiki, etc. I was only lucky that I
> thought of looking in the DTD to see that it was possible, and that the
> "Constant" class from way back in version 1.0.1 has been indexed by
> Google to see what the syntax was supposed to be.
> I'd be happy to contribute some documentation if I know what form is best.

Struts has documentation on using validator:


> Thanks,
> - -chris

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

View raw message