cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Man <>
Subject Re: Bug in AbstractValidatorAction?
Date Tue, 28 Aug 2001 17:36:34 GMT
On Tue, Aug 28, 2001 at 06:09:31PM +0100, Chris Newland wrote:
> Hi All,
> I'm a little confused by the behaviour in AbstractValidatorAction for
> parameters that have the nullable property set to "yes".
> If the parameter is nullable and I don't set the value in the form (so it
> becomes null) then the method validate<Type>(...) will set the value to its
> default value and then apply any other constraint tests set on the property.
> If one of these constraint tests fails then the form validation fails which
> is not what I expected since I declared that the parameter could be null in
> the first place!
yes, that should be the expected behavior...

> Also, is it correct that if the default is not set for a nullable parameter,
> this will cause an NPE when any other constraint is tested (on the default,
> since this is substituted for a nullable parameter).
> I can patch this is people agree this is a bug, but maybe the design was
> that you could not have a parameter that has both constraints *and* the
> ability to be null:
if you have a patch, send it to the list and I'll apply it, otherwise give me
some time to fix it :-))

> <!-- if they enter their age it must be between 18 and 120 -->
> <parameter type="long" name="age" min="18" max="120" nullable="yes"/>
> Thanks,
> Best Regards,
> Chris
martin man

"Only dead fish swims with a stream"                         Malcolm Muggeridge
gpg_key_fingerprint: 2CC0 4AF6 92DA 5CBF 5F09  7BCB 6202 7024 6E06 0223

To unsubscribe, e-mail:
For additional commands, email:

View raw message