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" />
上一篇:Win Server 2008 R2 IIS 默认只能添加一个 443 HTTPS 端口,更换证书


下一篇:Python模块的动态加载机制