Java Reference
In-Depth Information
• Custom error messages contained in resource bundles registered with the applic-
ation by the application architect using the resource-bundle element in the
configuration file.
When a converter or validator is registered on an input component, the appropriate error
message is automatically queued on the component.
A page author can override the error messages queued on a component by using the fol-
lowing attributes of the component's tag:
converterMessage : References the error message to display when the data on
the enclosing component can not be converted by the converter registered on this
component.
requiredMessage : References the error message to display when no value has
been entered into the enclosing component.
validatorMessage : References the error message to display when the data
on the enclosing component cannot be validated by the validator registered on this
component.
All three attributes are enabled to take literal values and value expressions. If an attribute
uses a value expression, this expression references the error message in a resource bundle.
This resource bundle must be made available to the application in one of the following
ways:
• By the application architect using the resource-bundle element in the config-
uration file
• By the page author using the f:loadBundle tag
Conversely, the resource-bundle element must be used to make available to the ap-
plication those resource bundles containing custom error messages that are queued on the
component as a result of a custom converter or validator being registered on the compon-
ent.
The following tags show how to specify the requiredMessage attribute using a value
expression to reference an error message:
Click here to view code image
<h:inputText id="ccno" size="19"
required="true"
requiredMessage="#{customMessages.ReqMessage}" >
...
</h:inputText>
<h:message styleClass="error-message" for="ccno"/>
Search WWH ::




Custom Search