Servlet Paths

The following shows the result of the various HttpServlet methods that give information about the paths and URL, etc. that resulted in the servlet being invoked. The output differs depending on how the servlet is mapped in web.xml, so two examples are given.

This page just serves as a quick reminder for the values of the following methods: -

String pathInfo = req.getPathInfo();
String method = req.getMethod();
String pathTranslated = req.getPathTranslated();
String queryString = req.getQueryString();
String servletPath = req.getServletPath();
String requestUri = req.getRequestURI();
String requestUrl = req.getRequestURL().toString();

http://localhost:8080/ClearViewProxy/install/ClearViewClient.jad?invite=abcdef

For servlet-mapping /install/*

pathInfo: /ClearViewClient.jad
method: GET
pathTranslated: C:\Users\kevin\workspace\ClearViewProxy\webapp\ClearViewClient.jad
queryString: invite=abcdef
requestUri: /ClearViewProxy/install/ClearViewClient.jad
servletPath: /install
requestUrl: http://localhost:8080/ClearViewProxy/install/ClearViewClient.jad

For servlet-mapping *.jad and *.jar

pathInfo: null
method: GET
pathTranslated: null
queryString: invite=abcdef
requestUri: /ClearViewProxy/install/ClearViewClient.jad
servletPath: /install/ClearViewClient.jad
requestUrl: http://localhost:8080/ClearViewProxy/install/ClearViewClient.jad
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-Share Alike 2.5 License.