读取配置文件参数

配置文件代码:

 

java代码:

复制代码
try{
     Properties prop = new Properties(); 
     //读取属性文件horizon.properties
     String params = request.getSession().getServletContext().getRealPath("/")+"WEB-INF\\workflow-conf\\properties\\horizon.properties";
     InputStream in = new BufferedInputStream (new FileInputStream(params));
     prop.load(in);     ///加载属性列表
     String basicVacationDay = prop.getProperty("basicVacationDay");
     String tallestVacationDay = prop.getProperty("tallestVacationDay");
     String base = prop.getProperty("base");
     in.close();
}catch(Exception e){
     e.printStackTrace();
}
复制代码

 

posted @   岁月淡忘了谁  阅读(524)  评论(0编辑  收藏  举报
努力加载评论中...
点击右上角即可分享
微信分享提示