spring mvc 动态读配置文件
来源:互联网 发布:淘宝代理免费加盟 编辑:程序博客网 时间:2024/06/06 03:16
package com.autohome.common;import java.io.*;import java.util.Properties;public class PropertyUtil { private static Properties props; private static void loadProps() { props = new Properties(); InputStream in = null; try { in = PropertyUtil.class.getClassLoader().getResourceAsStream("Config.properties"); props.load(in); } catch (FileNotFoundException e) { } catch (IOException e) { } finally { try { if (null != in) { in.close(); } } catch (IOException e) { } } } public static String getProperty(String key) { if (null == props) { loadProps(); } return props.getProperty(key); } public static String getProperty(String key, String defaultValue) { if (null == props) { loadProps(); } return props.getProperty(key, defaultValue); }}
阅读全文
0 0
- spring mvc 动态读配置文件
- spring MVC配置文件解读
- spring mvc配置文件解析
- spring mvc 配置文件
- Spring MVC配置文件
- Spring MVC的配置文件
- spring MVC 配置文件解析
- spring mvc配置文件
- Spring mvc配置文件解读
- spring MVC配置文件
- Spring MVC配置文件编写
- spring mvc配置文件错误
- Spring MVC 核心配置文件
- spring-mvc配置文件
- spring-mvc配置文件
- Spring动态加载配置文件
- 【spring】动态加载配置文件
- spring的MVC入口配置文件
- jq写一个渐入渐出
- Python3图片爬虫
- C++学习笔记之鼠标绘图
- 访问nginx服务器下*.html文件是提示404错误
- Swift:iOS App 上传App Store -xcode8.3.3
- spring mvc 动态读配置文件
- mybatis 分页查询
- Android完整性校验
- 润乾v5自定义配色方案
- 梯度下降与delta法则
- fetchsize of JDBC
- ruby
- 面向对象OOP
- Linux使用jstat命令查看jvm的GC情况