Webapps shouldn't know nor care where the web server is located. You can obtain and read a webapp's resources using the HttpServletRequest getResource() and getResourceAsStream methods.
You should not attempt to access other webapp's resources, and you should
NEVER attempt to write within a deployed webapp's directories. Always use external directories.
Likewise, you shouldn't attempt to access any of the webapp server's files or directories within a webapp.
There is, of course, one exception to the above, and that's the case where the webapp in question is a server control webapp such as the
Tomcat Manager webapp. But for normal business apps, no.
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.