applicationContext.xml import spring模块配置文件
2017-01-18 11:11
495 查看
applicationContext.xml import spring模块配置文件
在struts2 +spring +
hibernate集成开发柜架中,spring的配置文件也可以分模块,然后在applicationContext.xml中引入即可,方法如下:
<?xml version="1.0" encoding="UTF-8"?>
[xhtml]
view plain
copy
print?
<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">
<!-- 引用各模块的spring配置文件 -->
<import resource="conf/partner/partner-spring.xml"></import>
</beans>
<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"> <!-- 引用各模块的spring配置文件 --> <import resource="conf/partner/partner-spring.xml"></import> </beans>
但需要注意的是resource中引入的文件的地址要用相对路径,不然会出错。
相关文章推荐
- applicationContext.xml import spring模块配置文件
- Spring配置文件applicationContext.xml(2)之AOP
- Hibernate SQL方言 (hibernate.dialect) Spring配置文件applicationContext.xml
- 读取applicationContext.xml(spring配置文件)文件
- Hibernate与Spring整合,配置文件applicationContext.xml
- 一个典型的Spring的applicationcontext.xml配置文件
- spring+hibernate 配置文件(applicationContext.xml)实例
- Hibernate与Spring整合,配置文件applicationContext.xml
- 详解Spring的applicationContext.xml配置文件
- 请慎用spring-ClassPathXmlApplicationContext手动加载spring配置文件
- Spring 配置文件applicationContext.xml的切割原则
- Spring配置文件applicationContext.xml(3)开启事务和注解
- Spring的配置文件,可以用applicationContext.xml+applicationContext.properties
- Spring添加事物支持 applicationContext.xml配置文件
- 读取Spring的配置文件applicationContext.xml几种方法
- Spring的配置文件applicationContext.xml
- spring+hibernate applicationContext.xml配置文件写法
- Spring的applicationContext.xml中配置映射文件
- 一个典型的Spring的applicationcontext.xml配置文件
- 一个典型的Spring的applicationcontext.xml配置文件