HttpServletRequest的getRequestURL()和getRequestURI()方法
经常用到但每次都不记得应该使用哪个方法
,今天特地抽时间写下来,方便以后查阅。
访问URL:http://localhost:7001/GetDataWeb/a/b/c.data
- getRequestURL()=http://localhost:7001/GetDataWeb/a/b/c.data
- getRequestURI()=/GetDataWeb/a/b/c.data
看来L比I长,所以得到的结果字符串也比较长,哈哈。