Win a copy of Head First Agile this week in the Agile forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Relative or absolute path  RSS feed

 
sandy sean
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is /graphics/image.png a relative path or absolute path?
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66208
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is not absolute.

What type of relative URL it is, server-relative or context-relative, is impossible to say without more info. If /graphics is the context path, then it is the former, otherwise the latter.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66208
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
See the JspFaq for more info on the types of paths.
 
sandy sean
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
your answer contradicts the answer given by Vinko at http://stackoverflow.com/questions/181805/absolute-path-relative-path

it says
Absolute paths start with / and refer to a location from the root of the current site (or virtual host).

Relative paths do not start with / and refer to a location from the actual location of the document the reference is made.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66208
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you read the FAQ I pointed to?

People use the terms incorrectly all the time.

Absolute paths start with / and refer to a location from the root of the current site (or virtual host).

That is a server-relative path. Not an absolute path. An absolute path is a complete URL that identifies the resource.

A key phrase to attend to here is "a location from the root of the current site". If it's "from" something else, it's relative, not absolute.

Relative paths do not start with / and refer to a location from the actual location of the document the reference is made.

This is a page-relative path.

It's kind of like the term "application server". People argue endlessly over what it means.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!