On Wed, Feb 10, 2010 at 11:46 PM, Christopher Schultz
<ch...@christopherschultz.net> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> 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>
>
> ...it 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.

http://tinyurl.com/yhe66nm

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:

http://svn.apache.org/repos/asf/struts/struts1/trunk/core/src/main/java/org/apache/struts/validator/ValidatorPlugIn.java

> 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:

http://struts.apache.org/1.3.10/faqs/validator.html#ConstantsVariables

Niall

> Thanks,
> - -chris

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org

Reply via email to