File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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 REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "need of getPathInfo()" Watch "need of getPathInfo()" New topic

need of getPathInfo()

Maulin Vasavada
Ranch Hand

Joined: Nov 04, 2001
Posts: 1873
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.
Maulin Vasavada
Ranch Hand

Joined: Nov 04, 2001
Posts: 1873
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?
I agree. Here's the link:
subject: need of getPathInfo()
It's not a secret anymore!