In ValidationResources.java function addOldArgRules does not set value of
“resource”, like:
String resource = attributes.getValue("resource");
if (resource != null && !"".equals(resource)) {
arg.setResource(resource);
}
As a result I've got struts validation message "Field can not be less than null
characters."
Because in config there is defined a value '2' for minlength, but commons.jar
searches for resource with name '2' in resource bundule.
Configuration:
<field property="name"
depends="required,minlength,maxlength">
<arg0 key="fieldForm.name"/>
<arg1
name="minlength"
key="${var:minlength}"
resource="false"
/>
<arg1
name="maxlength"
key="${var:maxlength}"
resource="false"
/>
<var>
<var-name>minlength</var-name>
<var-value>2</var-value>
</var>
<var>
<var-name>maxlength</var-name>
<var-value>4</var-value>
</var>
</field>
http://svn.apache.org/viewcvs?rev=381425&view=rev
This affects only the deprecared arg0 - arg3 elements. If you switch to the
newer "arg" format (available in the 1.1 dtd) then you shouldn't have any
problems:
<arg position="1"
name="minlength"
key="${var:minlength}"
resource="false"
/>