java中HttpServletRequest可获取的URI方法介绍

作者:简简单单 2014-06-25

HttpServletRequest 方法可获取的URI, 以http://localhost:8080/project/path/test?param=val 为例
request.getPathInfo():返回/path/test
request.getRequestURL():返回http://localhost:8080/project/path/test
request.getRequestURI():返回/project/path/test
request.getServletPath():返回/project
request.getQueryString():返回param=val

相关文章

精彩推荐