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" />

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM