Back to course

Building Your First Controller

Spring Boot 0 to Hero: The Complete Java Backend Masterclass

The @RestController

To handle web requests, we use @RestController.

java @RestController public class HelloController { @GetMapping("/hello") public String sayHello() { return "Hello Spring Boot!"; } }