欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

Spring之 context:exclude-filter 与 context:include-filter

程序员文章站 2022-06-22 23:51:14
...
1.在Spring的applicationContext.xml(主容器)中,将Controller(控制器)的注解打消掉
<context:component-scan base-package="com">
<context:exclude-filter type="annotation" experession="org.springframework.stereotype.Controller" />
</context:component-scan>


2.在SpringMVC配置文件中将Service注解给去掉
<context:component-scan base-package="com">
<context:include-filter type="annotation" expression="org.springframework.stereotype.Controller" />
<context:exclude-filter type="annotation" expression="org.springframework.stereotype.Service" />
</context:component-scan>
相关标签: 随记