Documentation
JSFToolbox

Search 

Contents

  1. Introduction
  2. Getting Started
  3. Developing Web Sites
  4. Using Components
  5. Internationalization
  6. Code View Support
  7. Design View Support
  8. Keyboard Shortcuts
  9. Tag Object Toolbars
  10. JSF Server Behaviors
  11. Property Inspectors
Selected 12. JSF Tag Reference

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.