Reading properties from tomcat

前端 未结 6 1482
逝去的感伤
逝去的感伤 2020-12-15 23:02

What is the best practice for reading config file(s) for your application. Which folders in tomcat server are \"on the classpath\".

I tried placing my config file in

6条回答
  •  臣服心动
    2020-12-15 23:16

    add .properties file in apache-tomcat-7.0.78\conf folder File configDir = new File(System.getProperty("catalina.base"), "conf"); File configFile = new File(configDir, "dashboardiframes.properties"); InputStream stream = new FileInputStream(configFile);Properties properties = new Properties(); properties.load(stream);

提交回复
热议问题