Relative/Absolute path question

Discussion in 'HTML' started by zidered, Aug 18, 2004.

  1. zidered

    zidered Guest

    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
     
    zidered, Aug 18, 2004
    #1
    1. Advertising

  2. zidered

    lostinspace Guest

    ----- 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".
     
    lostinspace, Aug 18, 2004
    #2
    1. Advertising

  3. zidered

    zidered Guest

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


    "lostinspace" <> wrote in message
    news:_AIUc.1296$...
    > ----- 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".
    >
    >
     
    zidered, Aug 18, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Matt
    Replies:
    3
    Views:
    19,720
    Sudsy
    Jul 8, 2004
  2. Thomas Guettler
    Replies:
    3
    Views:
    791
    Andrei
    Oct 27, 2003
  3. Radu
    Replies:
    2
    Views:
    43,408
  4. Nigel Wilkinson
    Replies:
    2
    Views:
    420
    Nigel Wilkinson
    Jul 25, 2005
  5. Alex
    Replies:
    2
    Views:
    140
Loading...

Share This Page