Spring MVC 去除不扫描

Spring MVC中去除不需扫描的类:

1
2
3
4
<context:component-scan base-package="com.foo" use-default-filters="false">
<context:include-filter type="regex" expression="com.foo.bar.*Config"/>
<context:include-filter type="regex" expression="com.foo.config.*"/>
</context:component-scan>