April 2018
Intermediate to advanced
202 pages
4h 48m
English
JSR-303 is the specification for Java Bean Validation. It makes it possible to use annotations such as @NotNull, @Email, and @Size to indicate constraints in a Java Bean. Java Bean Validation is a specification and there are several implementations for it, two of the most popular ones being Hibernate Validation and Apache Bean Validation. Since we are already using Hibernate in this chapter's example, it makes sense to use Hibernate Validation as well. This is done by adding the hibernate-validator dependency in the pom.xml file:
<dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-validator</artifactId> <version>6.0.2.Final</version></dependency>
After this, we can use the annotations available ...
Read now
Unlock full access