On 11/28/06, Thomas Thomas <[EMAIL PROTECTED]> wrote:
Hi,
since I added a constraint for the length with minlength, I have the
following errror :
28-nov.-2006 21:31:33 org.apache.struts.validator.DynaValidatorForm validate
GRAVE: org.apache.struts.util.StrutsValidator
org.apache.commons.validator.ValidatorException:
org.apache.struts.util.StrutsValidator
at org.apache.commons.validator.ValidatorAction.loadValidationClass(
ValidatorAction.java:623)
at org.apache.commons.validator.ValidatorAction.executeValidationMethod(
The method signature in your validation class (i.e. StrutsValidator)
doesn't match up with what you have defined in the "methodParams"
element for your minlength validator.
I have the following code :
[...]
<validator name="minlength"
classname="org.apache.struts.util.StrutsValidator"
method="validateMinLength"
methodParams="java.lang.Object,
org.apache.commons.validator.ValidatorAction,
org.apache.commons.validator.Field,
org.apache.struts.action.ActionMessages,
org.apache.commons.validator.Validator,
javax.servlet.http.HttpServletRequest"
depends="required"
msg="errors.minlength"/>
[...]
<form name="loginForm">
<field property="login" depends="required,minlength">
<arg key="required.login"/>
<arg name="minlength" key="${var:minlength}"
resource="false"/>
<var>
<var-name>minlength</var-name>
<var-value>2</var-value>
</var>
</field>
[...]
Also can u tell me what ${var:minlength} will display ?
It will use the value in the "minlength" <var> element (which is "2"
in your case) as the second argument for your minlength message - what
it will display will depend on the message you've set up in the
resource bundle for the minlength message (key errors.minlength in
your case).
Niall
I need to display a message in French.
Thank u for any help !
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]