Controller
Learn Controller (Spring MVC Fundamentals, Spring MVC) with worked examples, diagrams and interview questions. Free on JavaSchoolLab.
Fresher Notes Controller is a class that receives web requests, calls the business layer and chooses what to return. Stereotype : @Controller is detected by component scanning; @RestController adds @ResponseBody for APIs. Mapping : @RequestMapping at class level sets a prefix, and @GetMapping or @PostMapping on methods set the path and verb.