优雅的整合SSM之<context:component-scan/>

自作多情 提交于 2019-12-02 16:54:58

  去除applicationContext.xml和spring-mvc.xml中的重复部分。

1、applicationContext.xml中

<context:component-sacn base-package="">

  <context:exclude-filter type="annotation" expression="org.springframework.stereotype.Controller" />

</context:component-sacn>

2、spring-mvc.xml中

<context:component-scan
        base-package="cn.rigid.hoistmnteg.controller"
        use-default-filters="false">
        <context:include-filter type="annotation"
            expression="org.springframework.stereotype.Controller" />
    </context:component-scan>

 

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!