一个残缺的申请地址

http://[username:password@]www.host.com[/contextPath]/servletPath/pathInfo?name=中国
contextPath上下文门路,如果部署在根目录下,则省略上下文门路。

例如:
http://localhost/上下文门路/servlet门路/门路信息?name=中国

Request URL: http://localhost/**%E4%B8%8A%E4%B8%8B%E6%96%87%E8%B7%AF%E5%BE%84**/*servlet%E8%B7%AF%E5%BE%84*/**%E8%B7%AF%E5%BE%84%E4%BF%A1%E6%81%AF**?name=*%E4%B8%AD%E5%9B%BD*

办法名称原始值浏览器编码后服务器是否解码解码后
getContextPath()contextPath上下文门路%E4%B8%8A%E4%B8%8B%E6%96%87%E8%B7%AF%E5%BE%84
getServletPath()servletPathservlet门路servlet%E8%B7%AF%E5%BE%84/servlet门路
getPathInfo()pathInfo门路信息%E8%B7%AF%E5%BE%84%E4%BF%A1%E6%81%AF/门路信息
getQueryString()queryStringname=中国name=%E4%B8%AD%E5%9B%BDname=中国

Firefoxchrome 测试,中文字符浏览器采纳UTF-8编码并加%。