29.7 Validation Using JSF Standard Validators

Validating input is an important step in collecting information from users. Validation helps prevent processing errors due to incomplete, incorrect or improperly formatted user input. For example, you may perform validation to ensure that all required fields contain data or that a zip-code field has the correct number of digits. The JSF Core Tag Library provides several standard validator components and allows you to create your own custom validators. Multiple validators can be specified for each input element. The validators are:

  • f:validateLength—determines whether a field contains an acceptable number of characters.

  • f:validateDoubleRange and f:validateLongRange—determine whether numeric input ...

Get Java How to Program (early objects), 9/e now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.