# The Java EE 7 Tutorial

# 21 Introduction to Bean Validation

Validating input received from the user to maintain data integrity is an important part of application logic. Validation of data can take place at different layers in even the simplest of applications, as shown in Developing a Simple Facelets Application: The guessnumber-jsf Example Application. The `guessnumber-jsf` example application validates the user input (in the `h:inputText` tag) for numerical data at the presentation layer and for a valid range of numbers at the business layer.

The Java API for JavaBean Validation ("Bean Validation") provides a facility for validating objects, object members, methods, and constructors. In Java EE environments, Bean Validation integrates with Java EE containers and services to allow developers to easily define and enforce validation constraints. Bean Validation is available as part of the Java EE 7 platform.

The following topics are addressed here:

- Using Bean Validation Constraints

- Validating Null and Empty Strings

- Validating Constructors and Methods

- Further Information about Bean Validation