|
The Validator tag registers a named Validator instance on the
component associated with the enclosing tag. The JavaServer Faces
framework includes three standard validators (see the
validateDoubleRange, validateLength, and validateLongRange tags) but
the Validator interface can be implemented by classes that provide
custom validation for your application. This tag accepts one value
matching the validator ID you assigned to your validator class in your
Faces configuration file. The body content of this tag must be empty.
Example:
<h:inputText id="emailAddress" value="#{customerBean.customer.emailAddress}"> <f:validator validatorId="emailAddressValidator" /> </h:inputText> <h:message for="emailAddress" />
HTML Output
<input id="form:emailAddress" name="form:emailAddress" type="text" value="fake@email"/> Invalid email address.
|