beehive-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Carlin Rogers" <carlin.rog...@gmail.com>
Subject NetUI annotation for ValidateCustomRule requires message or messageKey attribute
Date Tue, 22 Aug 2006 16:30:25 GMT
I have a question about the grammar for the declarative validation of a
custom rule. ValidateCustomGrammar is implemented so that either "message"
or "messageKey" attributes are required in the @ValidateCustomRule
annotation.

The validation-rules.xml that a user creates for the rule must contain a msg
attribute on the <validator> element. The msg attribute is "a generic
message key to use when this validator fails.  It can be overridden by the
'msg' element for a specific field." So if the specific form field does not
include a message, then the message key defined in the <validator> element
would be used.

An example of this case is the customvalidator in the netui-samples. At the
moment the external form bean does not go through the grammer checker (see
BEEHIVE-1127) but it does generate the validation.xml without having the
message key for the specific fields. Running the sample works because the
message key is used from the <validator> element defined in the
custom-validator-rules.xml of the sample. When the external form bean of
this sample goes through the checker it will fail, unless the messageKey is
added to the @ValidateCustomRule annotations on the fields.

Would it makes sense to remove the requirement that message or messageKey
exist in the ValidateCustomGrammar to give users the option that they just
define the key in the validator-rules.xml or is it better that they continue
to always explicitly define the message key? Just curious.

Kind regards,
Carlin

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