This subsection describes procedures for using Bean Validation from CDI.
To perform the validation processing using Bean Validation with CDI:
The following is an example of implementation using Bean Validation from CDI.
The first example shows an implementation of the servlet that registers the information for which validation is required.
public class EmployeeServBv extends HttpServlet{ |
In this example, the Bean Validation annotation is applied in the BV_CDI bean.
The next example shows an implementation of the validation definition for the Bean that stores the data to be validated.
import javax.validation.constraints.NotNull; |