request:获取请求的URL

http://localhost:8080/day10_2/AServlet?username=xxx&password=yyy
    > String getScheme():获取协议,http
    > String getServerName():获取服务器名,localhost
    > String getServerPort():获取服务器端口,8080
    > *****String getContextPath():获取项目名,/day10_2
    > String getServletPath():获取Servlet路径,/AServlet
    > String getQueryString():获取参数部分,即问号后面的部分。username=xxx&password=yyy
    > String getRequestURI():获取请求URI,等于项目名+Servlet路径。/day10_2/AServlet
    > String getRequestURL():获取请求URL,等于不包含参数的整个请求路径。http://localhost:8080/day10_2/AServlet

原文地址:https://www.cnblogs.com/danyuzhu11/p/6655218.html