I use properties files and the ResourceBundle class in my web application for internationalization (as outlined here: https://docs.oracle.com/javase/tutorial/i18n/resbundle/concept.html).
I now have a properties file for dynamic content (such as user comments) which I would like to update (ie: write to) while the web app is deployed.
This topic has been discussed already, mainly: Where to place and how to read configuration resource files in servlet based application? (My specific case is addressed in the last paragraph).
Can someone elaborate on how and why I would put the properties file outside of the web application. Also,
1) What ramifications would this have for accessing the file through the ResourceBundle.getBundle()
method (if the properties file is outside of the web app then accessing it with "packagename.filename" will no longer work).
2) I would like to write to the properties file but I'm not sure how to locate it (so that it will work when I deploy my application on a web server). Right now, I just locate the properties file in the project's "build" folder. But I understand that when I deploy, all of the project's files will be in tomcat under the "document root". Is there a way to locate the file so that it will work when deployed too? (right now the properties files exist both in the build
folder and in the src
folder).