InputStream from local machine to tomcat deployed webapp-Collection of common programming errors

Using per host property files helps in this scenario. Generally you want to contain all differences between environments to your property files.

Check out PropertyPlaceholderConfigurer for handling switching property files.

You’d extend that to handle the {ENV} placeholder and execute it from Spring similar to this


    

in appname-LOCAL.ini have this

text.filename=C:\Users\temp\file.txt

and in appname-PROD.ini change it to a mounted drive or a different local path, something accessible from the viewpoint of your server like this

text.filename=Z:\Users\temp\file.txt