This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Absolute path , Relative Path

 
Gagan Indus
Ranch Hand
Posts: 346
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ServletContext's getRequestDispatcher method accepts only absolute paths, and not relative paths.
But ServletRequest's getRequestDispatcher method accepts both.
I am nt clear about wot is relative path and wot is absolute path
( One book says " absolute pathname shld begin wid a / " . but oh ! i thought it to be property of relative path? like when giving url's in html file? i seems totally out of sync )
Can anyone help clear my doubt.

------------------
Gagan (/^_^\) SCJP2
Die-hard JavaMonk -- little Java a day , keeps u going .
 
Allan Moster
Ranch Hand
Posts: 153
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"/" must be referring to canonical path. This is relative to the server's root directory.
I view it this way, if you specify a complete URL, then that's absolute. If you describe the path to a page relative to where the current page is, then that's relative.
 
Peter den Haan
author
Ranch Hand
Posts: 3252
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Allan Moster:
"/" must be referring to canonical path. This is relative to the server's root directory.
Actually, RequestDispatchers work relative to the context root, i.e. the path to which the web application is mapped.
Why this the difference between ServletRequest.getRequestDispatcher() and ServletContext.getRequestDispatcher()? Remember that the ServletContext is associated with the web application as a whole. The RequestDispatcher it gives you cannot handle relative paths; what should they be relative to? The ServletRequest object, on the other hand, encapsulates a specific request. That's why it can make sense of a relative path: it has something the path can be relative to.
- Peter
 
Gagan Indus
Ranch Hand
Posts: 346
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thankx Allan , Peter
now i got , relative to wot they mean when they say 'relative'
------------------
Gagan (/^_^\) SCJP2
Die-hard JavaMonk -- little Java a day , keeps u going .
 
Ashik Uzzaman
Ranch Hand
Posts: 2373
Eclipse IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Gagan, this is an absolute URL http://www.javaranch.com/ubb/Forum18/HTML/000368.html
and "Image/cool.gif" may be a relative URL ..... here relative in terms of the home directory of the document that is referring to another uniform resource .....
Tell me which book u r mainly studying 4 these nice queries now-a-days in this forum....
------------------
Muhammad Ashikuzzaman (Fahim)
Sun Certified Programmer for the Java� 2 Platform
--When you learn something, learn it by heart!
 
Gagan Indus
Ranch Hand
Posts: 346
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ashik
thankx for ur relative/absolute path tip-off
i am reading Java-server-prog j2ee ed ( old edition ) by wrox , coz dis is only book i have
and sometimes i read servlet specs too , but reading on computer monitor annoy's me
anyway , which books/resources are u using ?

------------------
Gagan (/^_^\) SCJP2
Die-hard JavaMonk -- little Java a day , keeps u going .
 
Sreenivasa Majji
Ranch Hand
Posts: 224
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
No offence to anybody. While reading some of the messages times I get a feeling that I am reading a coded message. I noticed some people use some cryptic words (ofcourse you won't find them in the dictionary) like wot, 4, cos, da, abt. I would rather skip the message than reading it. .
My $0.02
/Sreenivasa Kumar Majji.
 
Ashik Uzzaman
Ranch Hand
Posts: 2373
Eclipse IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Gagan, u'll get my book list and preparation list here .
originally posted by majji :

Hi,
No offence to anybody. While reading some of the messages times I get a feeling that I am reading a coded message. I noticed some people use some cryptic words (ofcourse you won't find them in the dictionary) like wot, 4, cos, da, abt. I would rather skip the message than reading it. .
My $0.02

Just to get some cultural touches and save some times we r coding our messages... ...anyway nice observation majji...but plz don't skip man....

------------------
Muhammad Ashikuzzaman (Fahim)
Sun Certified Programmer for the Java� 2 Platform
--When you learn something, learn it by heart!
[This message has been edited by Ashik uzzaman (edited October 28, 2001).]
 
Bal Sharma
Ranch Hand
Posts: 273
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How do you get cultural touch using coded message? Alash! You guys have attached compiler to decode your language. Your post doesn't cover only one sector OR only one specific area. Once you publish, it is for all people of this planet who serf these pageses. Please be kind to us. Try to hlep us what you mean? If you really love coding message why don't email only those who loves it? Why for others?
OK I WRTE?
WOT U DD I DUNO BT I DDNT LKE IT. ITS VVVVRY PAINFUL. IF PSSBL TRY 2 WRT PLN ANLISH. EVBDY UNDRSTD PLN ANLISH. NT COD MSG. ALL PPL R NT JMS BND 007.
Do you understand it? How long did it take to decode my message? Did you have fun decoding it? If everybody start writing this way my dear who gonna come back JAVARANCH? AaHa! I saved typing and I added cultural felling too? Didn't I?
If you guys are trying to invent new language and JavaRanch supports it. Forget about it, discard this message, I do not have to say anything? I will just discard your message whatever it is, professionally how good it is? it does'nt matter. I will simply discard message when I see familiar code authour's name. I completely agree with Ashik uzzaman. I will not skip man....
Thanks. BK
[i]
Just to get some cultural touches and save some times we r coding our messages... ...anyway nice observation majji...but plz don't skip man....
[/B]

 
Sreenivasa Majji
Ranch Hand
Posts: 224
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks bala. At least I am not the only one who feels in this way. I don't understand how much time we save by typing "r" instead of "are".
/Sreenivasa Kumar Majji.
[This message has been edited by sreenivasa majji (edited October 28, 2001).]
 
Bal Sharma
Ranch Hand
Posts: 273
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
YOU ARE WELCOME. What you said was absolutely right. BK
Originally posted by sreenivasa majji:
Thanks bala. At least I am not the only one who feels in this way. I don't understand how much time we save by "r" instead of "are".
/Sreenivasa Kumar Majji.

 
Ashik Uzzaman
Ranch Hand
Posts: 2373
Eclipse IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
originally posted by Bal Sharma :

OK I WRTE?
WOT U DD I DUNO BT I DDNT LKE IT. ITS VVVVRY PAINFUL. IF PSSBL TRY 2 WRT PLN ANLISH. EVBDY UNDRSTD PLN ANLISH. NT COD MSG. ALL PPL R NT JMS BND 007.

....excellent Sharma...u can do it better than others...

I will simply discard message when I see familiar code authour's name. I completely agree with Ashik uzzaman. I will not skip man....

So you are not skipping man....thanks...

------------------
Muhammad Ashikuzzaman (Fahim)
Sun Certified Programmer for the Java� 2 Platform
--When you learn something, learn it by heart!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic