注解扫描配置:
<!-- 扫描@Controller注解 -->
<context:component-scan base-package="com.fq.controller">
<context:include-filter type="annotation"
expression="org.springframework.stereotype.Controller" />
</context:component-scan>
<!-- 配置扫描注解,不扫描@Controller注解 -->
<context:component-scan base-package="com.fq">
<context:exclude-filter type="annotation"
expression="org.springframework.stereotype.Controller" />
</context:component-scan>
注:使用context:include-filter时,一定要在context:component-scan ;中设置属性use-default-filters=false; 否则还是用的默认的filter;而使用context:exclude-filter时就没这个必要