How do you implement security in a Spring Boot application?
Step-by-step Spring Boot security with a SecurityFilterChain, role rules, database users, password encoding, HTTPS and tests in the Spring Security 6 style.
Spread Your Knowledge. Questions with answers, tutorials and articles, newest first.
Step-by-step Spring Boot security with a SecurityFilterChain, role rules, database users, password encoding, HTTPS and tests in the Spring Security 6 style.
Learn three ways to define a custom CacheManager in Spring Boot: a fixed SimpleCacheManager, a dynamic AbstractCacheManager with TTLs, and a composite manager.
A step-by-step Spring Boot caching guide covering provider choice, per-cache expiry, eviction with @CachePut and @CacheEvict, and Actuator metrics.
Build a Thymeleaf upload form, receive files as MultipartFile in Spring Boot, store them safely and show success or error messages after a redirect.
th:action builds a form action URL from a Thymeleaf link expression, adding the context path and, with Spring Security, the CSRF token.
Validate Thymeleaf forms in Spring Boot with Jakarta annotations, @Valid, BindingResult, th:errors and custom constraint validators.
@Controller connects HTTP requests to Thymeleaf views in Spring MVC. See view resolution, path variables, redirects with flash attributes and fragment returns.
Configure Thymeleaf in Spring Boot and render dynamic HTML with expressions, formatting, message bundles, loops and a reusable TemplateEngine.
LocaleChangeInterceptor is a Spring MVC interceptor that changes the user's locale from a request parameter. See how to configure it in Spring Boot with message bundles.
Build a Spring Boot locale resolver that checks a cookie, then the Accept-Language header, and add a language-switch interceptor and tests.
Localize a Spring Boot API from the Accept-Language header: translated messages, ProblemDetail errors, validation text and MockMvc tests.
ResponseEntity lets a Spring controller control the HTTP status, headers and body of a response. See builder methods, Optional handling and when to use it.
Centralise error handling in Spring Boot with @RestControllerAdvice, custom exceptions, ProblemDetail responses and validation error handling.
Use @RestControllerAdvice and ProblemDetail to return one consistent error format in Spring Boot, and customise the /error endpoint for failures outside MVC.
Implement Converter to bind request parameters to your own types, or HttpMessageConverter to support new body formats, and register it the Spring Boot way.
ObjectMapper converts Java objects to JSON and back. Learn the core methods, how to configure and reuse it safely, and the common mistakes to avoid.
Use Jackson ObjectMapper to convert Java objects to JSON and back, with records, generics via TypeReference, annotations and polymorphic types.
@JsonProperty tells Jackson which JSON key a Java property maps to. See renaming, constructors, records and access modes, with the real behaviour of required.
Learn how to write a Jackson custom serializer with StdSerializer, apply it with @JsonSerialize, register it in a module, and what changes in Jackson 3.
@JsonTest starts only the JSON parts of a Spring Boot context so you can test serialization quickly. See JacksonTester examples and when to choose it.