@Controller
@Controller is a stereotype annotation
It will be scanned in the component scanning.
Example:
@Controller
public class WelcomeController {
@RequestMapping(value="/welcome", method=RequestMethod.GET, produces = "application/json")
public String welcome() {
return "welcome";
}
}
Here component scanner will create bean of WelcomeController in the application context.
We can annotate the WelcomeController with @Component and it can also create its bean but for the proper terminology for request handler classes spring provides @Controller annotation.