Today took a spring MVC project, how can not scan controller, finally found that the problem in use-default-filters= "false" above, the problem of random copy
(The default value is true, which is to scan some related annotations, including @controller, @Component, @Service, @Repository, etc.)
<context:component-scan base-package= "Com.example" use-default-filters= "false" >
</context:component-scan>
If configured to False, will look for similar configuration below Include-filter and Exclude-filter, a blacklist way, a white list, the above two are not equipped, so the default does not scan
<context:include-filter type= "Annotation" expression= "Org.springframework.stereotype.Controller"/>
<context:exclude-filter type= "Annotation" expression= "Org.springframework.stereotype.Controller"/>
Spring MVC annotation Scan problem, controller not scanned, use-default-filters= "false"