Conversion of the paths of the names of the image files ??
Anonymous
Ranch Hand
Joined: Nov 22, 2008
Posts: 18944
posted
0
what system should I use in order to use images in my web pages? the relative paths ( . and .. format i mean) have not been working. Where am I doing wrong? when I use http://ip_adress ort#/web_appln/images/xxx.jpg it shows up, but that should not be the optimal way!!
Bear Bibeault
Author and opinionated walrus
Marshal
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