获取properties中的 value
2015-12-09 09:50
441 查看
<span style="white-space:pre"> </span>Properties log4j_properties = new Properties(); <span style="white-space:pre"> </span>InputStream inputStream = null; <span style="white-space:pre"> </span>String configKey = "log4j.appender.R.File"; <span style="white-space:pre"> </span>String configPath=""; <span style="white-space:pre"> </span>String filePath =""; <span style="white-space:pre"> </span>try { <span style="white-space:pre"> </span>log4j_properties.load(Thread.currentThread().getContextClassLoader().getResourceAsStream("log4j.properties")); <span style="white-space:pre"> </span>configPath = log4j_properties.getProperty(configKey); //根据key值获取value <span style="white-space:pre"> </span>} catch (IOException e) { e.printStackTrace(); System.out.println("配置文件加载出错..."); }
相关文章推荐
- Java 中 StringBuilder 在高性能用法总结
- Arduino - 315/433MHz RF无线收发模块
- weblogic10异常:org.hibernate.QueryException: ClassNotFoundException: org.hibernate.hql.ast.
- serialVersionUID的作用
- Java-构建器模式(Buider模式)
- 自动取款机 UI开发总结
- iOS应用开发中使用UIScrollView控件来实现图片缩放
- Android之使用Android-query框架进行开发(二)
- Android之使用Android-query框架进行开发(一)
- zzulioj1818: squee_spoon and his Cube VI
- 仿淘宝Demo UI分析
- 利用treegrid的loadFilter显示列的子属性
- 黑马程序员---易错、易望、基础、重要知识点 ——API常用类1——StringBuffer/StringBuilder
- 272. Closest Binary Search Tree Value II
- terminating the instance due to error 119
- Fail to build seafile-server libevhtp
- 贝塞尔曲线UIBezierPath
- 在MySQL中创建实现自增的序列(Sequence)的教程
- UITextField设置大全
- UIButton的自定义