spring扫描多个路径,存在两个名称相同的类,扫描时过滤掉

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/YISHENGYOUNI95/article/details/80144533
	<context:component-scan base-package="com.windf">
		<context:exclude-filter type="annotation" expression="org.springframework.stereotype.Controller" />
	</context:component-scan>
	<context:component-scan base-package="com.whaty">
		<context:exclude-filter type="assignable" expression="com.whaty.framework.common.spring.SpringUtil" />
	</context:component-scan>

项目开发中遇到两个相同名称的类,在不同的路径下,扫描时过滤掉其中一个,使用expression过滤。

扫描多个路径下的类,直接再写一个<context:component>

猜你喜欢

转载自blog.csdn.net/YISHENGYOUNI95/article/details/80144533