12. JSF Tag Reference
Contents > JSF Tag Reference > JSF Core Tags
10. JSF Core Tag Reference
Contents > JSF Core Tag Reference > f:validateLength
f:validateLength |
|
The ValidateLength tag registers a LengthValidator instance on the component associated with the enclosing tag. This tag can be used to validate user input when the expected value is a string of a specific length.
Example:
<h:inputSecret id="password" value="#{userBean.user.password}">
<f:validateLength minimum="8" maximum="16" />
</h:inputSecret>
<h:message for="password" />
HTML Output
<input id="form:password" name="form:password" type="password"/>
"password": Value is shorter than the allowable minimum of 8 characters.
|
Tag Attributes
| maximum |
String |
| |
| The maximum attribute sets the maximum length of text allowed for this component. |
| minimum |
String |
| |
| The minimum attribute sets the minimum length of text allowed for this component. |
|