Job Concurrency and Locking for Multiple Users in Spring Batch
Use identifying job parameters, bounded executors and the right lock type to run Spring Batch jobs for many users at once without duplicates or conflicts.
2,882 posts about Java: questions with answers, tutorials and articles, newest first.
Use identifying job parameters, bounded executors and the right lock type to run Spring Batch jobs for many users at once without duplicates or conflicts.
The @Query annotation attaches custom JPQL or native SQL to Spring Data JPA repository methods. See parameter binding, modifying queries and projections.
Learn how to write fallback methods for circuit breakers in Spring Boot with Resilience4j, including signature rules, exception matching and testing.
logback-spring.xml is Spring Boot's file for advanced Logback setup. Learn the springProfile and springProperty extensions, rolling files and JSON logging.
Add, read and expose custom HTTP headers in Spring Boot with RestClient, WebClient, interceptors, controllers, filters and CORS.
Use @RestControllerAdvice and @ExceptionHandler to return consistent ProblemDetail error responses for every controller, including validation failures.
@ControllerAdvice shares exception handling, model attributes and binders across Spring controllers. Learn how to use it and @RestControllerAdvice.
CorsFilter applies CORS rules in the servlet filter chain and answers preflight requests. Learn Spring Boot and Spring Security setup with examples.
@PathVariable binds URL path segments to controller parameters. See naming, optional variables, type conversion and validation in Spring MVC.
Compare URI, header, media type and query parameter versioning for Spring Boot REST APIs and learn how to deprecate old versions safely.
@RestController exposes JSON REST endpoints in Spring. Walk through a CRUD controller with validation, status codes, content negotiation and testing.
Build a CRUD REST API in Spring Boot with @RestController, a record model, validation, correct status codes and a global ProblemDetail error handler.
Upload files in Spring Boot 3 with MultipartFile, configure size limits, store files safely, return clear errors and test the endpoint with MockMvc.
@RequestParam binds an uploaded file part to a MultipartFile method parameter. See single and multiple uploads, mixed form fields, validation and size limits.
Add file upload to Spring Boot using MultipartFile, multipart size limits, validation and safe storage on disk or in a database.
BindingResult holds type-conversion and Bean Validation errors for a model attribute, letting your controller redisplay a form instead of throwing an exception.
Replace default Bean Validation messages using annotation attributes, message keys and MessageSource, then return clean JSON errors from a global handler.
@Valid runs Bean Validation on a submitted Spring form object. Build a Thymeleaf form with field errors, BindingResult and a custom constraint.
Use Jakarta Bean Validation with @Valid and one global exception handler to return consistent, field-level 400 errors from every Spring Boot endpoint.
Add 404.html and 500.html under templates/error to replace the Whitelabel page, or take control with a custom ErrorController or ErrorPageRegistrar.