Relative paths in a page are relative to the
URL that you used to get to the page, and
not to the actual location of the page file.
When using "straight" URLs, these are the same so there's no problem. If you are using any kind of
servlet mapping (or any other type of mapping where the URL no longer reflects the folder structure on the disk) you'll have problems.
Two solutions come to mind:
1) Use context-relative URLs. For example, if your web app is named
xyz:
2) Use relative URLs as before, but use the <base> tag to set the URL to the one which you expect all relative references to be based on.
hth,
bear