Spring中关于xml导入其他xml问题
来源:互联网 发布:照片批量修改大小软件 编辑:程序博客网 时间:2024/05/20 05:03
如果我们在spring框架中配置了多个xml文件,我们可以在读取配置文件的时候把这些xml文件一下全都读取,也可以只读一个总的xml文件,在这个总的xml文件中把其他的xml全都都导入进来。
例如:
有一个名字叫student.xml的配置文件和teacher.xml的配置文件把他们导入到新的配置文件中
新建一个名字为import.xml的配置文件:
<import resource="teacher.xml"/>
<import resource="student.xml"/>
就可以把之前的两个xml文件导入该文件下,再通过java的类
String[] path = {"com/ioc/imp/import.xml"};
ApplicationContext container = new ClassPathXmlApplicationContext(path);
就可以直接读取一个或多个文件
例如:
有一个名字叫student.xml的配置文件和teacher.xml的配置文件把他们导入到新的配置文件中
新建一个名字为import.xml的配置文件:
<import resource="teacher.xml"/>
<import resource="student.xml"/>
就可以把之前的两个xml文件导入该文件下,再通过java的类
String[] path = {"com/ioc/imp/import.xml"};
ApplicationContext container = new ClassPathXmlApplicationContext(path);
就可以直接读取一个或多个文件
阅读全文
0 0
- Spring中关于xml导入其他xml问题
- 关于Spring中applicationContext.xml路径问题
- 如何在web.xml中导入其他xml
- Spring的XML解析中关于DTD的路径问题-
- Spring的XML解析中关于DTD的路径问题
- 关于PB9导入XML的问题
- spring学习中遇到的坑之 xml约束导入问题
- 关于javaweb中导入json或者xml文件出现小红叉问题
- Spring中applicationContext.xml位置问题
- Spring中applicationContext.xml路径问题
- spring boot导入xml配置文件
- spring boot导入xml配置
- 在 Spring 配置文件中导入 CXF 提供 Schema、XML 详情
- 在 Spring 配置文件中导入 CXF 提供 Schema、XML 详情
- 在 Spring 配置文件中导入 CXF 提供 Schema、XML 详情
- delphi 一个关于xml文件导入数据库的问题
- 关于wordpress导入xml文件无响应的问题。
- 关于web.xml中元素的问题
- 编译原理与编译构造 二义文法的处理、语义
- Javascript基础:typeof返回的数据类型
- solr相关
- Spring中的ioc
- pyspark aggregate函数使用问题(aggregate重写,aggregate中的函数参数限制)
- Spring中关于xml导入其他xml问题
- spring容器创建bean对象的方式
- MySQL索引背后的数据结构及算法原理
- PAT (Basic Level) Practise (中文)1028. 人口普查(20)
- shiro的quick-start
- Material Design控件之TabLayout
- 指针初学,简单应用
- Spring中的自定义事件
- Shiro:DelegatingFilterProxy