<!-- 自动扫描且只扫描@Controller -->
</context:component-scan>
配置在springMVC的配置文件中:
<context:component-scan base-package="com.demo.controller" use-default-filters="false">
<context:include-filter type="annotation" expression="org.springframework.stereotype.Controller"/></context:component-scan>