Java,J2EE,Weblogic,Oracle

java项目随笔
随笔 - 90, 文章 - 6, 评论 - 61, 引用 - 0
数据加载中……

java工程如果加载多个配置文件

 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>

posted on 2008-09-07 01:55 龚椿深 阅读(764) 评论(0)  编辑  收藏


只有注册用户登录后才能发表评论。


网站导航: