The first thing to realize is that although they LOOK the same, a URL is NOT actually a directory path. In many cases, they do map, but not all (as for example the Apache Alias directive). In fact, some webservers secure themselves by NOT assuming that the filesystem tree will map node-for-node and thus requiring explicit URI/directory mappings.
Among the things that can cause confusion is if you map a web app to a complex context using a mechanism such as the Tomcat <context> directive and/or a context definition in an EAR's application.xml file.
For example (from an EAR's application.xml):
Let's say that the directory structure looks like this:
The canonical URL for the image1 file would be something like
http://www.myserver.com:8080/wowser/images/image1.png For a JSP at
http://www.myserver.com:8080/wowser/index.jsp, the relative-to-root path for the image1 file would be "/images/image1.png" because the TOMCAT_ROOT/webapp/ directory would be implicit and the wowser/ would be part of the context root. Usually, of course, you'd just have "/" as the context root, so the image1 URL would be
http://www.myserver.com:8080/images/image1.png "../images/image1.png" would also work - in this case you're explicitly mapping relative to the referrer's context location rather than walking down from the context root.
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.