title: How to pass deployment dependant parameters to webapp
body: <p>In projects I work(ed) on, deployment parameters - such as storage path or DB login - are usually given through a parameter file, which is stored in the war file.</p>
  
  <p>I find that unsuitable because those values needs to be changed each time the webapp is packaged for a different deployment (dev vs prod, change of executing computer). The source code being versioned, this makes it even more bothering.</p>
  
  <blockquote>
    <p>Is there some better option to pass parameters such as listed above?</p>
  </blockquote>
  
  <p>By better, I mean:</p>
  
  <ul>
  <li>practical: simple to setup, change and explain to others</li>
  <li>separated from the war</li>
  <li>as independent as possible to the web container (if dependent, I'm using tomcat in prod)</li>
  </ul>
  
  <p><strong>Edit</strong></p>
  
  <p>I chose the <a href="https://stackoverflow.com/a/30459890/1206998">answer of @aksappy</a> to reward the work done in the answer and because it provided several methods using standard tools. However, depending on the context I could go for any other solutions:</p>
  
  <ul>
  <li><a href="https://stackoverflow.com/a/30461805/1206998">method of @Necreaux</a> has best simplicity</li>
  <li><a href="https://stackoverflow.com/a/30460032/1206998">method of @Luiggi Mendoza</a> has a good design and is still simple</li>
  <li><a href="https://stackoverflow.com/a/30459876/1206998">method of @OldCurmudgeon</a> would be a really good one if the code covered other cases.</li>
  </ul>