What is the @Controller annotation used for? How can you create a controller without an annotation?

@Controller :- @Controller is a spring MVC annotation to define a controller ,but in reality it’s just a Stereotype annotation.

=> You can even create a controller without @Controller by annotating the Spring MVC Classes using @Component annotation.

The real job of request mapping to the handler method is done using @RequestMapping.

Leave a Reply

Your email address will not be published. Required fields are marked *

*