读类路径下配置文件
来源:互联网 发布:geckofx js调用c 函数 编辑:程序博客网 时间:2024/05/01 21:13
--1--------------------------------------
ResourceBundle resource = ResourceBundle.getBundle("net/rubyeye/test/config");
得到net/rubyeye/test/下面的config.properties
value=resource.getString("url") ;//得到配置文件的url属性
得到net/rubyeye/test/下面的config.properties
value=resource.getString("url") ;//得到配置文件的url属性
--2--------------------------------
private Properties props = new Properties();
InputStream infile = this.getClass().getResourceAsStream("/SystemConfig.properties");
props.load(infile);
String url=props.getProperty("url");
String username=props.getProperty("username");
String username=props.getProperty("password");
InputStream infile = this.getClass().getResourceAsStream("/SystemConfig.properties");
props.load(infile);
String url=props.getProperty("url");
String username=props.getProperty("username");
String username=props.getProperty("password");
==
http://blog.csdn.net/baobeiSimple/archive/2007/08/24/1757922.aspx
- 读类路径下配置文件
- JAVA读配置文件--在类的根路径及当前类的路径下
- SSI下配置文件引用路径
- ubuntu下apache配置文件路径
- 读写类路径下自定义属性配置文件工具类
- 类路径下加载配置文件的最好方式
- java中获取当前项目类路径下的配置文件
- spring 加载非 类路径下的配置文件
- java 读配置文件路径。。
- junit下不同路径下的配置文件
- Windows下Emacs设置配置文件路径
- Python获取当前路径下的配置文件
- 读prop配置文件(涉及路径)
- 类路径读取(加载)配置文件
- 配置文件路径
- 配置文件路径
- ClassLoad类加载器读取ClassPath路径下的配置文件(一)
- Java日志组件logback使用:加载非类路径下的配置文件并设置定时更新
- JS 级联例子,可初始化选项(网易硬盘保存JS多种级联)
- 程序员能力矩阵
- Hibernate 多对多单向关联
- 手机产业综述
- C++实现单链表逆序
- 读类路径下配置文件
- Linux 内核/sys 文件系统介绍
- 数据库的索引
- english practice No.5
- siege 工具安装过程
- 通过gct
- 电子电路 专业术语表 英汉对照
- 不开心的一天
- Struts+Spring+Hibernate 整合笔记