How do you handle file storage in Spring applications?
Compare local disk, database and S3 file storage in Spring Boot, with secure upload code, multipart limits and the AWS SDK v2.
2,886 posts about Java: questions with answers, tutorials and articles, newest first.
Compare local disk, database and S3 file storage in Spring Boot, with secure upload code, multipart limits and the AWS SDK v2.
@RequestParam binds a multipart file field to a MultipartFile parameter in Spring. Learn single and multiple uploads, limits, @RequestPart and safe handling.
MultipartFile represents an uploaded file in Spring MVC. See how to bind, validate, store and test uploads, plus the size limits and security rules that matter.
Build a safe file upload in Spring Boot 3 with MultipartFile, a storage service, a REST endpoint, a Thymeleaf form and proper size and type validation.
JSON is the default for REST APIs, but XML still has a place. Compare syntax, size, tooling and content negotiation, with a Spring Boot example.
Configure Spring MVC content negotiation with ContentNegotiationConfigurer, a format query parameter, produces conditions and a custom ContentNegotiationStrategy.
The Accept header tells a server which response formats a client can handle. Learn its syntax, q values and how servers pick a representation.
Spring picks JSON, XML or a custom format from the Accept header. Learn produces, consumes, a format parameter and custom HttpMessageConverters.
MediaType represents HTTP media types in Spring. See how it drives consumes, produces, ResponseEntity and content negotiation.
Choose a versioning scheme and wire it into Spring. Covers the built-in API versioning in Spring Framework 7 and header or media type mappings on older releases.
Query parameter versioning keeps URLs stable and selects the API version with a parameter such as api_version=2. See how to implement it and when to avoid it.
Put the version in the route, give each major version its own controller and DTOs, and share logic in services. Includes Spring Framework 7 notes.
API versioning keeps existing clients working while your API evolves. Learn the main strategies, a Spring Boot example and how to retire old versions.
Learn how to configure CORS in Spring Boot with @CrossOrigin, global addCorsMappings and Spring Security, and how to debug preflight failures.
In Spring, @CrossOrigin attaches a CORS policy to a controller or handler method. See how it merges with global config and what each attribute does.
Define one CORS policy for all endpoints in Spring Boot with WebMvcConfigurer or a CorsFilter bean, and make it work with Spring Security.
CorsConfiguration holds Spring's CORS rules: allowed origins, methods, headers, credentials and preflight cache time. See how to register it and avoid common CORS errors.
Compare the ways to configure CORS in Spring MVC and WebFlux: @CrossOrigin, global configurers and CorsFilter, with working examples.
Annotations look the same, but MVC routes through DispatcherServlet and WebFlux through DispatcherHandler. Compare controllers, RouterFunction and filters.
Write a GlobalFilter or an AbstractGatewayFilterFactory for Spring Cloud Gateway, with pre and post logic, ordering, YAML and Java route registration.