Spring MVC Articles
6 articles about Spring MVC. Explore Spring Boot implementation, design, and operations across related topics.
-
Differences Between @Service, @Repository, and @Controller in Spring Boot and How to Use Them - From Their Relationship with @Component to Exception Translation
@Service, @Repository, and @Controller are all derived from @Component, but they differ in actual effects beyond DI registration, such as exception translation in @Repository and handler mapping in @Controller. This article demonstrates the differences with source code and verification code, and explains the criteria for choosing annotations for each layer with a quick reference table.
-
How to Receive Request Parameters in Spring Boot - Choosing Between @RequestParam, @PathVariable, @RequestBody, and @ModelAttribute
A guide to the four annotations for receiving client input in Spring Boot Controllers—@RequestParam, @PathVariable, @RequestBody, and @ModelAttribute—with criteria for choosing between them based on the input source: query strings, path variables, JSON bodies, and forms. Covers required/defaultValue, multiple values with List, and the 400 behavior on type conversion failures with implementation examples.
-
Spring Boot REST API Versioning Strategies - Choosing Between URL Path, Header, and Content-Type
Compare three approaches to versioning REST APIs in Spring Boot (URI path, custom header, and Accept header) with working implementation code. Covers decision criteria for choosing the approach that fits your team's API characteristics, plus a Swagger UI integration example.
-
Getting Started with Reactive Programming in Spring WebFlux - Differences from Spring MVC and When to Use Each
For Java developers familiar with Spring MVC, this article covers the non-blocking I/O mechanism of WebFlux, basic Mono/Flux operations, and endpoint implementation using RouterFunction. With a comparison table between Spring MVC and WebFlux and adoption criteria, you'll be able to decide whether to apply it to your own project.
-
Server-Side Rendering with Thymeleaf in Spring Boot: A Complete Guide to Forms, Validation, and Security Integration
A hands-on tutorial covering Spring Boot 3.x and Thymeleaf 3.1 end to end: HTML responses, form handling, Bean Validation error display, and Spring Security integration (CSRF and auth-aware view switching). Built around runnable code examples you can use as-is.
-
Difference Between Interceptor and Filter in Spring Boot - With Implementation Samples for Request Pre/Post Processing
For those wondering which to use between Spring Boot's Filter and HandlerInterceptor, this article first presents the criteria for choosing between them. It organizes the differences in execution timing, Spring DI management, and available information, then explains use cases such as authentication checks, request logging, CORS, and exception handling with implementation samples.