Find out who you are

When working within a ServletContext, there’s multiple ways of finding out different portions of the request URL. Given that the request URL is http://test.example.com/webapp/page?param=value, the different methods of the HttpServletRequest return the following:

getServletPath()            /page
getRequestURI()             /webapp/page
getRequestURL().toString()  http://test.example.com/webapp/page
getContextPath()            /webapp
getQueryString()            param=value