This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes Servlets and the fly likes need of getPathInfo() Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "need of getPathInfo()" Watch "need of getPathInfo()" New topic
Author

need of getPathInfo()

Maulin Vasavada
Ranch Hand

Joined: Nov 04, 2001
Posts: 1871
hi all,
can somebody explain me need of having getPathInfo() method in the HttpServletRequest object?
from the API i get that it is to get cgi variable PATH_INFO but then why we need PATH_INFO variable if we can achieve the same effect using parameters you know...
what i am missing?
is it the case that PATH_INFO was the earlier support before the support to parameters in the URL and now to maintain backword compatibiltiy servers support PATH_INFO variable?
please help me.
thanks.
maulin
Maulin Vasavada
Ranch Hand

Joined: Nov 04, 2001
Posts: 1871
alright,
i am realizing something.
PATH_INFO variable is used to form a value for PATH_TRANSLATED variable by the "web server" to get the physical path for the virtual path in PATH_INFO variable.
now as this is done by the web browser the application script is free of doing any processing and can directly access the PATH_TRANSLATED which makes the application script task little easier, right? so thats the purpose of having PATH_INFO instead embedding such information in the query string. if that information is in the query string then the application script needs to process it...
am i right in this derivation?
regards
maulin
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: need of getPathInfo()
 
Similar Threads
Servlet Mapping help
reading post request data in C module in apache http server
how do I know what the user has clicked?
Alternative to getPathTranslated?
javax.servlet.forward AND javax.servlet.include