ITeye博客

读取配置文件

ts88 · 2013-07-10 10:55 · snf · 企业架构 · Markdown

@Test
public void readRropertory() {
Properties properties = new Properties();
try {
       properties.load(this.getClass().getResourceAsStream("/conf/sample-setting.properties"));
       System.out.println(properties.get("envName"));
        } catch (IOException e) {
       // TODO Auto-generated catch block
       e.printStackTrace();
        }
}

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。