Validation Groups and Order
Explore how to use validation groups in Thymeleaf forms with Spring Boot to control the order of validations. Understand creating marker interfaces, setting group sequences, and applying the @Validated annotation to ensure logical validation flow and clear error messages.
We'll cover the following...
We'll cover the following...
In the Custom validator lesson, we had to ensure that the email was not empty in our custom validator due to the undefined order of the validations. We can influence the processing order of the validations by using validation groups.
Suppose we add some extra validations on CreateUserFormData, for example:
Without using validation groups, all validations are triggered at the same time, resulting in two ...