Hi can someone tell me what file path is getPathInfo() referring to? import java.io.*; import java.util.*; import javax.servlet.*; import javax.servlet.http.*; public class FileLocation extends HttpServlet { public void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { res.setContentType("text/plain"); PrintWriter out = res.getWriter(); if (req.getPathInfo() != null) { out.println("The file \"" + req.getPathInfo() + "\""); out.println("Is stored at \"" + req.getPathTranslated() + "\""); } } } What is the output of the above code?
Sean MacLean
author
Ranch Hand
Joined: Nov 07, 2000
Posts: 621
posted
0
According to the Servlet api getPathInfo(), "Returns: 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" Which I take to mean the xxx in a path like this http://www.site.com/servlet/MyServlet/xxx?name=value