Validating requests

JAX-RS offers an integration of HTTP endpoints into our system. This includes mapping of requests and responses into Java types of our application. However, the client requests need to be validated in order to prevent misuse of the system.

The Bean Validation standard provides validation of all kind of sorts. The idea is to declare validation constraints, such as this field must not be null, this integer must not be negative or this salary raise must align with the company policies, to Java types and properties. The standard already ships the typically required technically motivated constraints. Custom constraints, especially those that are motivated by the business functionality and validation, can be added as well. This ...

Get Architecting Modern Java EE Applications now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.