Hi, I have a application deployed into Tomcat. It's basically a jar file. This application has some settins sticked into the jar file. Then I could use this.getClass().getResourceAsStream("filename.properties") to load the settings in. However, after deploy, we might need to change these settings. That requires to open the jar and change the configuration file. I would like to put my configuration file outside the jar and have application to find it automatically. The problem is the application don't know where we are going to put the file before hand. Do you guys have ideas about that? The configuration contains a dozen of settings which perhaps it's not a good idea to leave them in system properties. Thanks, Bujin
Specifically for Tomcat users, this has an additional advantage:
Tomcat will look in the WEB-INF/classes directory before attempting the WEB-INF/lib directory.
So with clever coding, you can get a situation where the default properties are included with the jar file, but to override those settings, simply put that same properties file in the WEB-INF/classes directory, with appropriately overriden values... and it should be found first.