struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nicolas De Loof" <nicolas.del...@cgey.com>
Subject Re: FieldChecks.validateMinLengths()
Date Tue, 01 Jul 2003 13:44:32 GMT
I think this is the correct behaviour since "blank" fields have to be considered using the
"required" rule.

You can use both required + minlength rules if field is mandatory.

Nico.



> I started using struts validator. I just copied a bunch of stuff from 
> the struts example and started using that, and found that the minlength 
> validation actually returns true when the text field is blank.
> 
> This was my first attempt and I was trying to make sure I had got the 
> validator plug-in functioning correctly, so I actually spent a few hours 
> hunting down the reason why my blank field was passing validation even 
> though the minlength had been set to 1.
> 
> I discovered in the source code that this is normal behaviour - surely 
> that can't be the case? I would expect a blank field to fail validation 
> for minimum length. Or is this actually the case for reasons I'm not 
> aware of?
> 
> Thanks
> Adam
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org

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


Mime
View raw message