You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by James Coltman <ja...@majorband.co.uk> on 2001/06/01 16:22:35 UTC

Intake minLength rule

As far as I can tell when the minLength rule is set to 1 it will always
return true. i.e

  <rule name="minLength" value="1">Please enter a password</rule>

This is because in the assertValidity method in the DefaultValidator the
following branch logic will always be
executed when the value is less than 1 and the field has not been set to be
required.

        if ( !required && ( testValue == null || testValue.length() == 0) )
        {
            return;
        }

This means this rule will be classed as valid when the value is less than 1
and it is in fact invalid. Has anyone else come across this problem? The
requirement for this rule has probably been negated by the new 'required'
rule but I thought I should highlight the issue.

Comments?

James :)



---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org