@Controller annotation in Spring Boot

Опубликовано: 31 Май 2026
на канале: Java Boot Programmer
70
2

The @Controller annotation in Spring Boot is a stereotype annotation used to mark a class as a web controller in a Spring MVC application. It indicates that the class can handle HTTP requests and return responses, typically view names for rendering templates (e.g., HTML pages) or data when combined with @ResponseBody. As a specialization of @Component, it enables the class to be auto-detected during component scanning and registered as a bean in the Spring application context

https://gitlab.com/javabootprogrammer...

#entity #jpa #JavaAnnotations #springboot #hibernate #@Bean
#bean #RequestBody #controller #RestController #lazy #model #ModelMap #ModelAndView

▬▬▬▬▬▬ T I M E S T A M P S ⏰ ▬▬▬▬▬▬
00:00 Welcome to the channel
00:02 @Controller
01:46 @Controller Purpose
04:23 @Controller Example
05:12 @Controller with String
08:28 @Controller with PathVariable
09:36 @Controller with Lazy
14:04 @Controller JSON response
17:41 @Controller XML response
22:06 @Controller HTML response
27:38 Model , ModelMap and ModelAndView
34:46 @Controller vs @RestController
37:23 @RestController JSON and XML responses