According to Spring docs , to enable automatic detection of annotated controllers, you add component scanning to your configuration:
<context:component-scan base-package="org.springframework.samples.petclinic.web"/>
My question is: why is this necessary?
If the controller has an annotation to already indicate what it is, should this not be enough for Spring without scanning components?
source
share