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
时间: 2024-11-01 21:31:54