request.getRequestURL()和request.getRequestURI()的区别

request.getRequestURL() 返回全路径

request.getRequestURI() 返回除去host(域名或者ip)部分的路径

 

举例如下:

request.getRequestURL() : http://localhost:8080/project_name/user/login.do

request.getRequestURI() : /project_name/user/login.do

 

你可能感兴趣的:(request.getRequestURL()和request.getRequestURI()的区别)