In ASP.NET I have .config XML files which configure my applications. It is nice to be able to log on to the server and simply edit the XML when a configuration needs to change. The application self-detects this and restarts automatically.
How can I get the same convenience with Spring MVC?
(Currently I export my MVC applications to .war files which are deployed in Tomcat Web Application Manager. If I need to change settings in for instance root-context.xml I need to export, undeploy and deploy the application again. A tedious and risky operation.)
you could store the spring-configuration outside of your war (f.e. in the
conffolder of your tomcat).following snippet from
web.xmltells spring where to find the configuration file:or you could move things, which you need to change often from your
root-context.xmlto a properties-file and place it then outside the war.define a properties-placeholder in your spring-configuration to access the properties-file: