Read app config during servlet init.
Use java.io.tmpdir instead of hardcoding.