cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chris Newland" <>
Subject Bug in AbstractValidatorAction?
Date Tue, 28 Aug 2001 17:09:31 GMT
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!

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 they enter their age it must be between 18 and 120 -->
<parameter type="long" name="age" min="18" max="120" nullable="yes"/>


Best Regards,


Chris Newland
Software Research Engineer

Emorphia Ltd
Registered in England.  4133002
Mill House, Station Approach, Harlow Mill, Harlow, Essex, CM20 2EL, UK

Tel: +44 (0)1279 450100
Fax: +44 (0)1279 450102

Check out FIPA-OS at

This message may contain information proprietary to Emorphia so any
unauthorised disclosure, copying or distribution of its contents is strictly

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

View raw message