Skip to Content
JavaServer Faces
book

JavaServer Faces

by Hans Bergsten
April 2004
Intermediate to advanced
606 pages
20h 4m
English
O'Reilly Media, Inc.
Content preview from JavaServer Faces

Chapter 7. Validating Input

There are two types of input validation you must consider in any application: syntactic and semantic validation. A form field value that represents a date, for instance, must be written in a certain format (i.e., be syntactically correct) in order to be interpreted by the application. It may also have to follow other rules (i.e., be semantically correct) to be accepted, e.g., be a date in the future or later than another date.

In JSF, components perform syntactic validation typically during the conversion from a request parameter string value to the native type of the business data property bound to the component. For semantic validation, you can attach validators to the components. JSF comes with a set of standard validators for the most common validation needs and lets you develop custom validators for more complex rules. We’ll look at both alternatives in this chapter.

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Core JavaServer™ Faces

Core JavaServer™ Faces

David Geary, Cay S. Horstmann
Core JavaServer Faces, Second Edition

Core JavaServer Faces, Second Edition

David Geary, Cay Horstmann

Publisher Resources

ISBN: 0596005393Supplemental ContentErrata Page