What is the role of the ConstraintValidator interface?
How ConstraintValidator implements custom Bean Validation constraints in Spring Boot, with a full annotation, validator, controller and cross-field example.
2,881 posts about Java: questions with answers, tutorials and articles, newest first.
How ConstraintValidator implements custom Bean Validation constraints in Spring Boot, with a full annotation, validator, controller and cross-field example.
Define a @Constraint annotation, implement ConstraintValidator, and trigger it with @Valid. Examples use jakarta.validation for Spring Boot 3 and later.
CriteriaBuilder is the factory of the JPA Criteria API. See how it builds predicates and queries at runtime, with jakarta.persistence examples.
Build dynamic, composable filters with Spring Data JPA Specifications: repository setup, reusable predicates, paging, joins and performance tips.
Specification lets you build dynamic Spring Data JPA queries from small reusable predicates combined with and, or and not.
Use JpaSpecificationExecutor and small reusable Specification methods to build dynamic filters in Spring Data JPA, combined with allOf, and, or and paging.
Spring Security's SessionRegistry tracks HTTP sessions per user so you can limit concurrent logins, list active users and force sessions to expire.
@RequestMapping only shows the login page in Spring Boot; Spring Security processes the credentials. See a secure Spring Security 6 login setup.
Create a custom Thymeleaf login page, map it with a controller and configure formLogin in a Spring Security 6 SecurityFilterChain with remember-me and logout.
LogoutFilter handles logout requests in Spring Security by clearing the session and security context, then redirecting. See how to configure and extend it.
A step-by-step guide to form-login logout in Spring Security 6 and 7: CSRF POST form, success handler, cookie cleanup and Clear-Site-Data.
AuthenticationFilter turns a request into an Authentication, verifies it with an AuthenticationManager and stores the result. See how to use it in Spring Security 6.
Create a token class, an AuthenticationProvider and a filter, then register them in a SecurityFilterChain. Examples use Spring Security 6 and an API key credential.
Implement UserDetailsService, return a UserDetails with the password hash and authorities, and register a PasswordEncoder and a SecurityFilterChain bean.
ClientDetailsService looked up registered OAuth 2 clients in the legacy Spring Security OAuth project. It is end of life; use RegisteredClientRepository in Spring Authorization Server.
See how the OAuth2 client credentials grant works for service-to-service calls and how to implement client, authorization server and resource server in Spring.
Secure a Spring Boot REST API as an OAuth2 resource server with JWT validation, a SecurityFilterChain bean, and custom claim to authority mapping.
spring-security-oauth2 is an end-of-life library. See what it did and how to use current Spring Security OAuth2 client and resource server support instead.
Protect a Spring Boot REST API as an OAuth2 resource server that validates JWT access tokens, with scope and role rules and modern Spring Security 6 code.
In Spring AMQP, Queue stores messages and Exchange routes them. See exchange types, bindings, Spring Boot configuration and a producer and listener example.