Relative/Absolute path question

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
My directory structure is as follows -


savechanges.gif is in the buttons directory.

In the jsp directory I have a jsp file with this line in

 <img src="images/buttons/savechanges.gif">

When the jsp file is deployed on my webserver (tomcat 5 or Weblogic 8.1) the
image is displayed in the browser correctly.

But to get it to show in a package such as Dreamweaver the path has to look
like this "/images/buttons/savechanges.gif" with an
initial "/" - I do understand the difference between absolute/relative paths
but just can't see why this should be!

With the "/" in front it stops displaying in the browser!

Any ideas? - probably something really stupid I'm missing!



Re: Relative/Absolute path question

----- Original Message -----
From: "zidered" <>
Newsgroups: alt.html
Sent: Wednesday, August 18, 2004 8:52 AM
Subject: Relative/Absolute path question

Quoted text here. Click to load it

Actually (as per the directory structure you provided,) if your working in
the "jsp directory" the correct path for the example you provide would be
".. /images/buttons/savechanges.gif"

If you were in your root directory WEB-INF (higher than either jsp or
images) the link would then be "images/buttons/savechanges.gif".

In the event you were in a sub-directory of the jsp, perhaps "jsp/sib-jsp"
than the relative path would be "../../images/buttons/savechanges.gif".

Re: Relative/Absolute path question

thanks for that, got my thinking now, perhaps its the web server setup thats
wrong - cheers!

Quoted text here. Click to load it

Site Timeline