首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 软件管理 > 软件架构设计 >

spring加载多个配置文件的步骤

2012-09-07 
spring加载多个配置文件的方法1、????? 在Struts2.0 中加载多个 struts.xml?? ,用include file........

spring加载多个配置文件的方法

1、????? 在Struts2.0 中加载多个 struts.xml?? ,用<include file="........"></include>

???? 例如:
????? <struts>
??????????? <include file="com/test/user/action/user_struts.xml"></include>
?????????? <include file="com/test/shop/action/shop_struts.xml"></include>
???? </struts>

2、??????? 在Spring? 中加载多个? xml ,用 <import resource="........"/>
????????? 例如:
???? <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-2.0.xsd">
?????????? <import resource="classpath:com/test/user/dao/user_dao.xml"/>
?????????? <import resource="classpath:com/test/shop/dao/shop_dao.xml"/>
??? </beans>

热点排行