[ http://issues.apache.org/struts/browse/SHALE-303?page=all ]
Craig McClanahan updated SHALE-303:
-----------------------------------
Component/s: Validator
(was: Core)
> minlength and maxlengh validators not working
> ---------------------------------------------
>
> Key: SHALE-303
> URL: http://issues.apache.org/struts/browse/SHALE-303
> Project: Shale
> Issue Type: Bug
> Components: Validator
> Affects Versions: 1.0.3
> Environment: Java 1.5.0_08
> Reporter: Pawe? Walkiewicz
> Priority: Trivial
>
> i'am using shale validators with facelets (ver 1.1.11) and they do not work
> as expected..
> 1. http://shale.apache.org/features-commons-validator.html says that for a
> mask validator i should put
> <s:validatorVar name="mask" value="[4-6].*"/> in my code..
> this doesn't work.. I figured out tha it works only if I put mask attribute
> into commonsValidator element like this:
> <s:commonsValidator type="mask"
> arg="#{label}"
> server="true"
> client="true"
> mask="[4-6].*">
> 2. I tried the minlength and maxlength validators like this:
> <s:commonsValidator type="minlength"
> arg="#{label}"
> server="true"
> client="true"
> minlength="5"/>
> It doesn't work.. CommonsValidator throws NullPointerException from convert
> method at line:
> String source = converterHelper.asString(context, obj.getClass(), obj);
> After some debugging I figured out that attributes minlength and maxlength
> are not set in validator (only these because arg, min, max and mask are set).
> I found that they are not set because of the wrong names of the setting
> methods...
> renaming methods setMaxLength and setMinLength to setMaxlength and
> setMinlength resolves the problem..
> please fix it or correct me if I'm wrong..
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/struts/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira