• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Conversion of the paths of the names of the image files ??

 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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!!
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
merci Bear,
appreciated really. I have forgotten this important detail.
reply
    Bookmark Topic Watch Topic
  • New Topic