This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Servlets and the fly likes what is request.getPathInfo() Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "what is request.getPathInfo() " Watch "what is request.getPathInfo() " New topic

what is request.getPathInfo()

Prakash Dwivedi
Ranch Hand

Joined: Sep 28, 2002
Posts: 452
helloo friends
can some body explain me what does getPathInfo() method oh HttpServletRequest returns. i have read the java docs it says "Returns any extra path information associated with the URL ". but what extra path are they taliking about, is it query string?
plz explain

Prakash Dwivedi (SCJP2, SCWCD, SCBCD)
"Failure is not when you fall down, Its only when you don't get up again"
Debashish Chakrabarty
Ranch Hand

Joined: May 14, 2002
Posts: 226

From API: "getPathInfo() will return a String specifying extra path information that comes after the servlet path but before the query string in the request URL; or null if the URL does not have any extra path information"
Hence for the following URL the method would return "foo".
If you are wondering still what the "extra path" could be here is a nice explanation I bookmarked for me.
[ February 17, 2003: Message edited by: Debashish Chakrabarty ]

I agree. Here's the link:
subject: what is request.getPathInfo()
Similar Threads
HttpServletRequest API
extra path
directory path
getPathInfo() and getPathTranslated()
request URI doubt?