This may be do to an arg problem in recent commons-validator nightly builds. I fixed this last night so it should show up in today or tommorrow's commons-validator build. You could also download commons-validator-1.0.2.jar and use that.

You should also be aware that Struts will not generate any javascript validations for password fields other than "required". The less hackers know about your password requirements the better. Of course, there's nothing stopping you from altering the validator-rules.xml file javascript.

David


From: "Marco Tedone" <[EMAIL PROTECTED]>
Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
To: "Struts-user-list" <[EMAIL PROTECTED]>
Subject: Question about maxlength with Validator
Date: Sun, 8 Jun 2003 11:03:00 +0100

Hi, now that I got Validator working properly, I'm trying to declare a
validation by which an edited field cannot be greater than a certain size,
but it doesn't work.

Here follows what I've done:

In the struts-config.xml file, i declared among the others, a  password
property in the DynaValidatorForm with the size attribute set to 10

<form-property name="password" type="java.lang.String" size="10" />

In the validation.xml file, I declared the validation for my field as
follows:

<field property="password" depends="required,maxlength">
<arg0 key="error.required.password"/>
</field>

I thought that maxlength would rely on the 'size' attribute declared in the
struts-config.xml file.

I obtain a message like the following when Validator performs the
validation:

* Password can not be greater than null characters.

What am I doing wrong?

Thanks,

Marco




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


_________________________________________________________________
STOP MORE SPAM with the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=features/junkmail



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



Reply via email to