Spring Boot Controllers
java
dev.to
When learning Spring Boot, one of the most confusing things is seeing controllers written in many different ways. Sometimes a method returns a DTO. Sometimes ResponseEntity. Sometimes void, String, ModelAndView, CompletableFuture, Mono, and more. At first it feels random. But each return type has a specific purpose. This article is a practical cheat sheet to quickly understand the most common controller patterns in Spring Boot REST APIs. What Is a Controller? A controller ha