Instead, use the properties files and write the code so that 1) it reads the value from it each time or 2) it could reload the value by command or 3) it automatically reloads the file at certain intervals.
If you put the properties file somewhere in the path to the webapp runtime classes or add its path to the path to the webapp runtime path, then you can easily access / load it as follows:
Properties properties = new Properties(); properties.load(Thread.currentThread().getContextClassLoader().getResourceAsStream("filename.properties")); String value = properties.get("key");
source share