spring1-test17-使用context:exclude-filter指定扫描包时不包含的类

<!--实验17-使用指定扫描包时不包含的类:
    使用context:exclude-filter指定扫描包时不包含的类:
    扫描时可以排除一些不要的组件。
    type="annotation":指定排除规则,按照注解进行排除,标注了指定注解的就排除。
    expression="org.springframework.stereotype.Repository":写注解的全类名。
    type="assignable":指定排除某个具体的类,按照类排除。expression后面写类的全类名。

    type="aspectj":后来aspectj表达式。
    type="custom":自定义一个TypeFilter,自己写代码决定哪些使用。
    type="regex":正则表达式来排除。
-->
<context:component-scan base-package="com.atgugui.dao">
    <context:exclude-filter type="annotation" expression="org.springframework.stereotype.Repository"/>
</context:component-scan>
发布了52 篇原创文章 · 获赞 1 · 访问量 2248

猜你喜欢

转载自blog.csdn.net/Shen_R/article/details/104954513