兩段代碼貼出來(lái)
<!-- 掃描的包路徑 去掉Controller注解 -->
<context:component-scan base-package="com.yuxuan66.yxbaseframe">
<context:exclude-filter type="annotation"
expression="org.springframework.stereotype.Controller" />
</context:component-scan>
<!-- 只掃描Controller 注解 -->
<context:component-scan base-package="com.yuxuan66.yxbaseframe"
use-default-filters="false">
<context:include-filter type="annotation"
expression="org.springframework.stereotype.Controller" />
<context:include-filter type="annotation"
expression="org.springframework.web.bind.annotation.ControllerAdvice" />
</context:component-scan>
這兩項(xiàng)配置到底有什么用? 有什么好處?