Bean Validation Articles
-
How to Validate Spring Boot @ConfigurationProperties with Bean Validation - A Fail Fast Implementation Guide to Detect Configuration Errors at Startup
Learn how to combine Spring Boot's @ConfigurationProperties with Bean Validation (@Validated/@NotBlank/@Pattern) to instantly detect configuration mistakes at application startup before they cause production incidents. Covers @Valid propagation for nested validation, 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.
-
Spring Boot Thymeleaf Server-Side Rendering Implementation Guide - Forms, Validation, and Security
A comprehensive implementation tutorial for Spring Boot 3.x × Thymeleaf 3.1, covering HTML responses, form handling, Bean Validation error display, and Spring Security integration (CSRF/authentication display switching). Based on code examples that work as-is.