zoukankan      html  css  js  c++  java
  • 读取配置文件参数

    配置文件代码:

    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();
    }
  • 相关阅读:
    Spring IoC
    Java软件安装
    Struts(一)
    Struts(二)
    Hibernate(六)
    Hibernate(五)
    Hibernate(二)
    Hibernate(四)
    Hibernate(三)
    Hibernate(一)
  • 原文地址:https://www.cnblogs.com/henuyuxiang/p/6500712.html
Copyright © 2011-2022 走看看