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>

你可能感兴趣的:(DAO,spring,xml,struts)