首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 软件管理 > 软件架构设计 >

怎么读取property配置文件

2012-09-10 
如何读取property配置文件如何读取property配置文件:Resource res new ClassPathResource(文件名.prope

如何读取property配置文件
如何读取property配置文件:

Resource res = new ClassPathResource("文件名.property");
Properties prop = new Properties();
try {
prop.load(res.getInputStream());
} catch (IOException e) {
e.printStackTrace();
}

INTERFACE_HOST = prop.getProperty("interface.host");
SIP_HTTP_PORT = prop.getProperty("sip.http.port");
INTERFACE_SIP = INTERFACE_HOST + ":" + SIP_HTTP_PORT;

热点排行