title: How do you save name-value pairs in Tomcat environment?
body: <p>We have a servlet that needs certain variables like passwords, encryption salts, etc., not to be saved on the file system permanently. This is what we do currently (summary):</p>
  
  <p>During initialization,</p>
  
  <ol>
  <li><p>A Perl script sets ReadMode to 2 to mask stdout echo, prompts user for the variables, filters a known file to put them in and invokes tomcat/bin/startup.sh</p></li>
  <li><p>The servlet init() method reads the variables from the file and deletes it (the file).</p></li>
  </ol>
  
  <p>Problem:
  When the WAR is recompiled, tomcat tries to deploy it (autodeploy=true), which we want. But the data file is no longer there, so a FileNotFoundException is thrown (rightly so).</p>
  
  <p>Question: Is there a property or some HashMap/Table available to servlets where a few variables can be stored during the manual startup? The idea is that init() could check for them if the data file is not there during redeployment. Thank you, - MS.</p>