spring4.x组件扫描component-scan所有过滤stereotype
程序员文章站
2022-05-17 09:49:45
...
在spring-framework-4.2.6.RELEASE-dist\spring-framework-4.2.6.RELEASE\libs\org\springframework\stereotype
下有这4个类
<context:component-scan base-package="com.urthink.*"> <!-- <context:include-filter type="annotation" expression="org.springframework.stereotype.Service"/> <context:include-filter type="annotation" expression="org.springframework.stereotype.Repository"/> <context:include-filter type="annotation" expression="org.springframework.stereotype.Component"/> --> <context:exclude-filter type="annotation" expression="org.springframework.stereotype.Controller"/> </context:component-scan>