Web tier: servlets, JSP, Web frameworks: HttpServletRequest.getPathInfo( ) ???
What kind of information should HttpServletRequest.getPathInfo() method return?
- Posted by: Di He
- Posted on: July 12 2001 15:24 EDT
From document, it says this method returns a string containing any additional path information following the servlet path but precedes the query string. If the request is the request from a HTML (using POST), what is the additional path information (if servlet is at path/servlet)
Take the following URL as an example.
Servlet Name: myServlet
getPathInfo() would return /extra/path/info
This is effectively part of the URL which is nice from a hyperlink perspective, so it isn't affected by GET or POST.
That's one of the nice things about it actually. Often this is used to provide the action argument for a command pattern system.
Thank you, Tony.
Still have a question: in the
by my understanding, the servlet name is actionservlet and login is the extra path information. How can I get this login? I mean, is should I write HTML action part as
..../actionservlet/login ? And, login is a file name or something else?