title: Spring Multiple Environment Best Practices?
body: <p>I have just taken on this project and its in an interesting state.  I am trying to establish a local, dev, and production environment.  I have it working and was curious to know if there is a better way or if the way I am doing it has risks.  </p>
  
  <p>Inside my Dispacher-Servlet.xml i have this line:<br>
  <code>&lt;context:property-placeholder location="classpath:application_${spring.profiles.active}.properties" /&gt;</code>  </p>
  
  <p>Then I have a setenv.sh file that uses:<br>
  <code>JAVA_OPTS="$JAVA_OPTS -Dspring.profiles.active=local"</code></p>
  
  <p>Then inside of my controller to reference the variables I use:<br>
  <code>@PropertySource("classpath:application_${spring.profiles.active}.properties")</code></p>
  
  <p>Like I said it seems to work ok, it just doesn't seem to be what the documentation points you to do. </p>