I have this in one of my WEB-INF/web.xml files:
I can override the default path using a
Tomcat Context element (other appservers have similar mechanisms)
The application can then retrieve this value using JNDI by looking up "java:comp/env/server/uploadDir".
The secret of how to be miserable is to constantly expect things are going to happen the way that they are "supposed" to happen.
You can have faith, which carries the understanding that you may be disappointed. Then there's being a willfully-blind idiot, which virtually guarantees it.