title: Writing to properties file from web app
body: <p>I use properties files and the ResourceBundle class in my web application for internationalization (as outlined here: <a href="https://docs.oracle.com/javase/tutorial/i18n/resbundle/concept.html" rel="nofollow noreferrer">https://docs.oracle.com/javase/tutorial/i18n/resbundle/concept.html</a>).</p>
  
  <p>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.</p>
  
  <p>This topic has been discussed already, mainly:
  <a href="https://stackoverflow.com/questions/2161054/where-to-place-and-how-to-read-properties-files-in-a-jsp-servlet-web-application">Where to place and how to read configuration resource files in servlet based application?</a>
  (My specific case is addressed in the last paragraph).</p>
  
  <p>Can someone elaborate on how and why I would put the properties file outside of the web application.
  Also,</p>
  
  <p>1) What ramifications would this have for accessing the file through the <code>ResourceBundle.getBundle()</code> method (if the properties file is outside of the web app then accessing it with "packagename.filename" will no longer work).</p>
  
  <p>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 <code>build</code> folder and in the <code>src</code> folder). </p>