Having a Java web application, how does one read properties file only once when the app is deployed (storing them later in some singleton)? Meaning, configuration changes would require redeployment.
Otherwise, is there an alternative way to prevent an app from constantly reading .properties file? Previously I had settings in my web.xml file, but now .properties is required.
Code used to read app settings from JBoss configuration path:
File f = new File(System.getProperty("jboss.server.config.dir"),
"myappsettings.properties");
Properties p = new Properties();
p.load(new FileInputStream(f));
try {
db_name = p.getProperty("DATABASE_NAME"));
file_path = p.getProperty("FILE_PATH"));
...
} catch (Exception e) {
...
}