struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Scott Van Wart <sc...@indosoft.com>
Subject I can't put 'maxlength' validator values in my .properties file?
Date Wed, 16 Aug 2006 17:03:52 GMT
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: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message