Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > Relative/Absolute path question

Reply
Thread Tools

Relative/Absolute path question

 
 
zidered
Guest
Posts: n/a
 
      08-18-2004
My directory structure is as follows -

WEB-INF
|-----images
|-----buttons
|-----jsp

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!

thanks

harry


 
Reply With Quote
 
 
 
 
lostinspace
Guest
Posts: n/a
 
      08-18-2004
----- Original Message -----
From: "zidered" <>
Newsgroups: alt.html
Sent: Wednesday, August 18, 2004 8:52 AM
Subject: Relative/Absolute path question


> My directory structure is as follows -
>
> WEB-INF
> |-----images
> |-----buttons
> |-----jsp
>
> 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!
>
> thanks
>
> harry
>
>


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".


 
Reply With Quote
 
 
 
 
zidered
Guest
Posts: n/a
 
      08-18-2004
thanks for that, got my thinking now, perhaps its the web server setup thats
wrong - cheers!


"lostinspace" <(E-Mail Removed)> wrote in message
news:_AIUc.1296$(E-Mail Removed) ...
> ----- Original Message -----
> From: "zidered" <>
> Newsgroups: alt.html
> Sent: Wednesday, August 18, 2004 8:52 AM
> Subject: Relative/Absolute path question
>
>
> > My directory structure is as follows -
> >
> > WEB-INF
> > |-----images
> > |-----buttons
> > |-----jsp
> >
> > 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!
> >
> > thanks
> >
> > harry
> >
> >

>
> 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".
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Server.MapPath() croaking with "failed to map path", but path is legal awbacker@gmail.com ASP .Net 0 05-12-2005 10:50 PM
how to get application path? Is that my method in getting path wrong? James Java 2 12-07-2004 11:59 AM
absolute path versus relative path in JSP Matt Java 3 07-08-2004 08:31 PM
Bizzare: Invalid path to Access mdb, path is good Keith-Earl ASP .Net 1 05-03-2004 03:25 PM
Tomcat returning 404 error when using additional path (/servlet/myServlet/extra/path/info) Mupota Muchelemba Java 1 02-04-2004 12:43 AM



Advertisments