Bean Validation Articles
4 articles about Bean Validation. Explore Spring Boot implementation, design, and operations across related topics.
-
How to Validate List<DTO>, @RequestParam, and @PathVariable in Spring Boot - Why @Valid Doesn't Work and How to Handle the 3 Exceptions
A reverse-lookup guide to why element validation of a List-typed DTO annotated with @Valid, or @Min on @RequestParam/@PathVariable, doesn't work in Spring Boot 3.x, and how to fix it. Covers the differences between the 3 exceptions, unified error responses with @RestControllerAdvice, and indexed messages in the users[1].name format.
-
How to Validate Spring Boot @ConfigurationProperties with Bean Validation - A Fail Fast Implementation Guide for Detecting Configuration Errors at Startup
Learn how to combine Spring Boot @ConfigurationProperties with Bean Validation (@Validated/@NotBlank/@Pattern) to catch configuration errors at application startup, before they become production incidents. Covers nested validation with @Valid propagation, how to read startup error messages, and lightweight testing with ApplicationContextRunner, all with implementation examples.
-
How to Create Custom Validation Annotations in Spring Boot - @Constraint/ConstraintValidator Implementation Guide
A step-by-step guide to creating custom validations with @Constraint and ConstraintValidator, covering three patterns: phone number format, email duplication check (using DI), and password confirmation (cross-field). Encapsulate rules that @NotBlank / @Pattern cannot handle into reusable annotations and consolidate validation logic scattered across the Service layer.
-
Server-Side Rendering with Thymeleaf in Spring Boot: A Complete Guide to Forms, Validation, and Security Integration
A hands-on tutorial covering Spring Boot 3.x and Thymeleaf 3.1 end to end: HTML responses, form handling, Bean Validation error display, and Spring Security integration (CSRF and auth-aware view switching). Built around runnable code examples you can use as-is.