导入其他Spring配置文件,可以不用将所有的配置写在一个文件里。
通过下面 <import resource=“将导入的其他配置文件的URL”/>
<?xml version="1.0" encoding="utf-8" ?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd"> <!--import导入其他模块化Spring配置--> <import resource="cn/jjs/b_create/applicationContext.xml"/> <bean name="user" class="cn.jjs.bean.User" init-method="init" destroy-method="destroy"></bean> </beans>
Spring分模块化配置(XML)
最新推荐文章于 2022-03-03 10:35:46 发布