Spring怎么引入多个xml配置文件

方式一:在web.xml中通过<context-param> 标签引入

<context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>classpath*:META-INF/spring/*.xml</param-value>
</context-param>

方式二:在Spring的applicationContext.xml中通过<import/> 标签引入

<import resource="classpath:META-INF/service.xml" />
<import resource="classpath:META-INF/huatuo-service.xml" />
<import resource="classpath:META-INF/db.xml" />
<import resource="classpath:META-INF/huatuo-db.xml" />
<import resource="classpath:META-INF/db-mapper.xml" />
<import resource="classpath:META-INF/huatuo-db-mapper.xml" />
<import resource="classpath:META-INF/webservice.xml" />
<import resource="classpath:META-INF/dubbo.xml" />
<import resource="classpath:META-INF/spring/physicalExamService.xml" />

 

posted @ 2017-12-11 14:04  寻找风口的猪  阅读(10585)  评论(0编辑  收藏  举报