Skip to main content

@Controller

Learn @Controller (Controllers, Spring MVC) with worked examples, diagrams and interview questions. Free on JavaSchoolLab.

Fresher Notes @Controller is a stereotype annotation (a @Component ) that marks a class as a Spring MVC web controller found by component scanning. Return value : a String is a logical view name, and a Model carries data to the view. Mapping methods use @GetMapping , @PostMapping and similar, optionally under a class-level @RequestMapping .

More lessons in Controllers