Hello,
I'm trying to get i18n messages for declarative validation of my form
bean. I can't use the default MessageBundle in this case and I can't
get anything to work when I try to use another bundle. Is it possible?
I don't understand the javadoc for
Jpf.ValidatableProperty.displayNameKey: "A key in the default message
bundle or in the bundle specified by [EMAIL PROTECTED] MessageBundle#bundleName}
that will be used..."
Here is my latest attempt, any hints would be appreciated. Thanks!
@Jpf.Controller
(
messageBundles =
{
@Jpf.MessageBundle(
bundlePath=ContentConstants.CONTENT_JSP_RESOURCE_BUNDLE ),
// this message bundle annotation provides the message bundle
that we use in
// server-side declarative input validation
@Jpf.MessageBundle( bundleName="decValidation",
bundlePath="com.bea.jsptools.util.Validation")
},
validatableBeans =
{
@Jpf.ValidatableBean
(
type=RepositoryConfigForm.class,
validatableProperties =
{
// name is required
@Jpf.ValidatableProperty
(
propertyName=BaseContent.NAME_PROPERTY_NAME,
displayNameKey="${bundle.decValidation.name.displayName}",
[EMAIL PROTECTED](messageKey="${bundle.decValidatio
n.error.required}")
),
// connection class is required
@Jpf.ValidatableProperty
(
propertyName=BaseContent.CONNECTION_CLASS_PROPERTY_NAME,
displayNameKey="${bundle.decValidation.connectionClass.displayName}",
[EMAIL PROTECTED](messageKey="${bundle.decValidatio
n.error.required}")
)
}
)
}
)