I think you need to have at least Struts v1.2.8 unless you manually upgraded
the Commons Validator jar up to version 1.2.0.  If I understand correctly,
validator versions before 1.2.0 (Struts < 1.2.8) don't actually make use of
the "bundle" attribute in your validator xml files.

So, what version of Struts are you using (1.1.4?) and/or what version of the
Commons Validator are you using?  Have you tried replacing the commons
validator jar?  I think I read that some people have tried that for older
versions but I'm not positive.

Regards,
David

-----Original Message-----
From: Scott Van Wart [mailto:[EMAIL PROTECTED]
Sent: Wednesday, August 16, 2006 1:04 PM
To: user@struts.apache.org
Subject: I can't put 'maxlength' validator values in
my .properties file?

I tried the following:

  <field property="name" depends="maxlength">
    <msg name="maxlength" key="error.name.overflow" />
    <arg name="maxlength" bundle="constraints" key="name.length" />
  </field>

Now I figured that this would cause the maxlength validator to get the
value for maxlength from message resources, rather than hardcoding it
with var, var-name and var-value tags.  But it doesn't!  It only uses
this to pass to the {0} in the error message (in
org.apache.struts.validator.FieldChecks.validateMaxLength, version 1.1.4):

  // No reference to resources at this point, only in the exception handler
  int max = Integer.parseInt(field.getVarValue("maxlength"));

Am I missing something?

- Scott


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to