How do you implement internationalization (i18n) in Spring Boot?
Spring Boot auto-configures message sources, so i18n needs properties files and a locale resolver. Setup with Thymeleaf and cookie-based switching.
Spread Your Knowledge. Questions with answers, tutorials and articles, newest first.
Spring Boot auto-configures message sources, so i18n needs properties files and a locale resolver. Setup with Thymeleaf and cookie-based switching.
@ModelAttribute binds form and query parameters to Java objects and shares model data with views in Spring MVC. See examples, validation and common pitfalls.
Bind a form with th:object, validate it with @Valid and BindingResult, show field errors in Thymeleaf and redirect after a successful submit.
ThymeleafViewResolver turns controller view names into rendered Thymeleaf templates. See how Spring Boot configures it and how to set it up by hand.
Add the Thymeleaf starter, return view names from controllers, and build pages with loops, fragments and validated forms in Spring Boot.
Configure Spring MVC view resolvers for JSP, Thymeleaf and FreeMarker with Java config or Spring Boot properties, and order several resolvers correctly.
The old spring.resources.static-locations property is now spring.web.resources.static-locations. Learn the default folders, custom locations and caching.
Spring Boot serves files from /static, /public and /resources by default. Learn to customise locations, cache headers, versioning and security.
InputStreamResource streams data from an InputStream to the response without buffering the whole file. See headers, path safety, limits and when to use other resources.
@RequestPart binds a single multipart part, so a JSON object and a file can arrive in one Spring request. Learn usage, validation and pitfalls.
Upload files in Spring Boot 3 using MultipartFile and transferTo, set size limits, store under safe names, handle errors and test with MockMvc.
Build search endpoints in Spring Boot with Spring Data JPA, dynamic Specification filters and pagination, plus full-text options.
@RequestParam binds query, form and multipart values to controller method parameters. Learn its attributes, defaults, conversion and error handling.
Read, bind and validate query parameters in Spring MVC with @RequestParam, @ModelAttribute records, defaults, converters and clear 400 errors.
Dynamic filtering in Spring Data JPA uses the Criteria API through Specification. See how to build reusable filters with paging and sorting.
Filter data with optional request parameters and JPA Specifications, and filter requests with OncePerRequestFilter. Includes when to use each approach.
Set up Azure Blob Storage in Spring Boot with managed identity, a BlobServiceClient bean, and upload, download, list, delete and SAS examples.
Sort is Spring Data's portable way to describe ordering by property and direction. See how to build it, use it with repositories and pagination.
Put a Sort inside your Pageable and Spring Data JPA applies ORDER BY with LIMIT and OFFSET. Learn multi-field sorting, controller parameters and safe allow-lists.
Use Spring Cloud Azure starters with DefaultAzureCredential to connect Spring Boot to Blob Storage, Azure SQL and Cosmos DB without storing secrets.