title: How to portably read configuration data from a servlet
body: <p>I'm writing a Java servlet that needs to read some site-specific
  configuration data; I would like it to be easily accessible/modifiable
  by the sysadmins at deployment time.  There is no sensible default,
  so the data <em>has to</em> be provided by the site admin.<br>
  It consists of a few string key/value pairs (think Properties).
  It would only be read once (at initialization time).</p>
  
  <p>I'm aware of <a href="https://stackoverflow.com/questions/2015384/load-properties-file-in-a-java-servlet-deployed-in-jboss-as-a-war">this SO question</a>
  and the <code>ServletContext.getInitParameter()</code> mechanism, but as far as
  my understanding goes, they require the data to be bundled in the
  servlet package (either as a properties file, or specified in the
  <code>web.xml</code>), which makes it inconvenient to upgrade the servlet code.</p>
  
  <p>Is there any "standard" interface for a servlet to get this kind of
  key/value configuration data?  It would be ok if the programming
  interface is the same everywhere, but the actual way of setting the
  configuration data depends on the actual servlet container being used.</p>
  
  <p>I'm looking preferably at portable solutions, but I'd be content with
  something that only works in Tomcat and Jetty.</p>