Spring中操作applicationContext.xml
来源:互联网 发布:沼泽人思想实验知乎 编辑:程序博客网 时间:2024/06/05 04:39
ApplicationContext ac = null;
方法1. 在classpath根路径查找
ac = new ClassPathXmlApplicationContext("your.xml");
方法2. 在classpath下的test文件夹下查找
ac = new ClassPathXmlApplicationContext("classpath:test/your.xml");
方法3. 在某个类所在的路径中查找
ac = new ClassPathXmlApplicationContext("your.xml",HelloWorld.class);
方法4. 通过URL定位查找
ac = new ClassPathXmlApplicationContext("file:D:/aaa/bbb/your.xml");
方法5. 直接传入路径:
ac = new FileSystemXmlApplicationContext("D:/aaa/bbb/your.xml");
方法6. 指定多个配置文件
ac = new ClassPathXmlApplicationContext(
new String[]{"test1.xml","aaa/test2.xml"}
);
============
classpath*:
查找所有路径下的test.xml
ac = new ClassPathXmlApplicationContext("classpath*:*/test.xml");
- Spring中操作applicationContext.xml
- spring+hibernate中applicationContext.xml详解
- spring+hibernate中applicationContext.xml详解
- spring+hibernate中applicationContext.xml详解
- Spring中 applicationContext.xml文件标头
- spring+hibernate中applicationContext.xml详解
- Spring中applicationContext.xml的…
- spring定时任务applicationContext.xml中配置
- 关于Spring中applicationContext.xml路径问题
- spring applicationContext.xml 中context:property-placeholder
- spring获取applicationContext.xml中bean内容
- Spring中applicationContext.xml位置问题
- Spring中applicationContext.xml路径问题
- Spring中BeanFactory、ApplicationContext、xml的作用
- about spring applicationContext.xml
- spring 的 applicationcontext.xml
- spring配置文件applicationContext.xml
- spring applicationContext.xml配置
- dhtmlxgrid所支持的列类型
- Domino开发者入门地图
- 系统超时跳转至首页解决
- C# 调用DLL
- 深入理解Aireplay-ng各种攻击及其原理
- Spring中操作applicationContext.xml
- WPF中bitmapimage与byte[]格式相互转换
- 没有实践,当然没有机会
- java I/O流,输入流,输出流,输入输出流,InputStream,FileInputStream,文件流,byte,url
- Qt 类型编辑实例-指定QPushButton 菜单指示器的子控制
- winpe下硬盘不存在,自动安装恢复ghost不存在
- 软件实施顾问的基本技能和需求控制
- 三角函数
- 列表ul的基本用法分析