Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

what is request.getPathInfo()

 
Prakash Dwivedi
Ranch Hand
Posts: 452
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
thanks
 
Debashish Chakrabarty
Ranch Hand
Posts: 231
Firefox Browser Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
http://mysite.com/servlet/DCServlet/foo?qString=myQStr 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.
Regards,
[ February 17, 2003: Message edited by: Debashish Chakrabarty ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic