You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@shale.apache.org by "Pawe? Walkiewicz (JIRA)" <ji...@apache.org> on 2006/10/18 11:43:25 UTC

[jira] Updated: (SHALE-303) minlength and maxlengh validators not working

     [ http://issues.apache.org/struts/browse/SHALE-303?page=all ]

Pawe? Walkiewicz updated SHALE-303:
-----------------------------------

    Priority: Trivial  (was: Major)

it works fine with minLength="5" :)

>I agree that these should be made consistent but please verify that minLength="5" works.

> <s:commonsValidator type="minlength"
>                          arg="#{label}"
>                          server="true"
>                          client="true"
>                          minLength="5"/> 

> minlength and maxlengh validators not working
> ---------------------------------------------
>
>                 Key: SHALE-303
>                 URL: http://issues.apache.org/struts/browse/SHALE-303
>             Project: Shale
>          Issue Type: Bug
>          Components: Core
>    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