Define environment variables in Tomcat

Sometimes you want to change the behaviour of your code without recompiling / deploying. A way to do this is defining environment variables that you can change at any time. A typical use case is for database connection properties (username, password, port, etc).