beehive-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Deepak Natarajan" <>
Subject Beehive Form Field Validation
Date Wed, 19 Dec 2007 14:52:00 GMT
Hi -


I have a very basic question about form validation in Beehive. Any
help/guidance will be much appreciated.


My understanding is that Beehive uses/extends Apache Commons Validatior
framework. According to the Beehive Javadocs for validationRules
ve/netui/pageflow/validation/ValidatorRules.html) there are various methods
inherited from FieldChecks such as validateInteger etc. But the
corresponding annotations to use these methods seem to be missing...or am I
confusing myself here? Can anyone provide a simple example to use these? The
beehive netui samples doesnt have any extensive examples in this area. 


Also, is it necessary that a form bean properties should be string types and
not their real domain type (with the conversion ability checked in a custom
rule)? Its a fundamental question, and the reason I'm asking is that for a
BigDecimal bean property for example, if I enter a String value in the form,
a NumberFormatException occurs obviously - since the validation seems to be
done after the property setter is run, not before. Other techniques that
I've encountered before are to have validation checks inside the setter, or
some client-side checks etc. For me it seemed intuitive that the
@Jpf.ValidateProperty should have been on the setter (which is where I put
it initially until the IDE corrected me!) so that before the bean property
is set, type validation is done - but now when the container does the
automatic conversion to the object type, it fails with a
NumberFormatException. What is a good pattern for this case? 


Also, any idea which version of Apache commons validator is being used by
Beehive 1.0.2?


Thanks in advance



  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message