HttpServletRequest常用获取URL的方法
来源:互联网 发布:阿里云域名解析设置 编辑:程序博客网 时间:2024/06/06 03:07
1、request.getRequestURL()
返回的是完整的url,包括Http协议,端口号,servlet名字和映射路径,但它不包含请求参数。
2、request.getRequestURI()
得到的是request URL的部分值,并且web容器没有decode过的
3、request.getContextPath()
返回 the context of the request.
4、request.getServletPath()
返回调用servlet的部分url.
5、request.getQueryString()
返回url路径后面的查询字符串
示例:
当前url:http://localhost:8080/CarsiLogCenter_new/idpstat.jsp?action=idp.sptopn
request.getRequestURL()http://localhost:8080/CarsiLogCenter_new/idpstat.jsp
request.getRequestURI() /CarsiLogCenter_new/idpstat.jsp
request.getContextPath()/CarsiLogCenter_new
request.getServletPath() /idpstat.jsp
阅读全文
0 0
- HttpServletRequest常用获取URL的方法
- HttpServletRequest常用获取URL的方法
- HttpServletRequest常用获取URL的方法
- HttpServletRequest常用获取URL的方法
- HttpServletRequest常用获取URL的方法
- HttpServletRequest常用获取URL相关的方法
- HttpServletRequest常用获取URL的方法
- HttpServletRequest常用获取URL的方法
- HttpServletRequest常用获取URL的方法
- HttpServletRequest常用获取URL的方法
- HttpServletRequest常用获取URL的方法
- HttpServletRequest常用获取URL的方法
- 【javaWeb】HttpServletRequest常用获取URL的方法
- HttpServletRequest常用获取URL的方法
- HttpServletRequest常用获取URL的方法
- HttpServletRequest常用获取URL的方法
- HttpServletRequest——获取URL的方法
- HttpServletRequest获取URL的相关方法
- 杭电ACM OJ 1040 As Easy As A+B 水(快速排序小变形 或者 维护当前值输出)
- tensorflow中conv2d卷积测试
- 【机器学习圈子里的裙带关系】学术“朋友圈”罪与罚
- 学习记录4
- 用端口复用技术解决tcp连接下服务器主动关闭连接后不能立即重启的问题
- HttpServletRequest常用获取URL的方法
- Zuul网关服务使用详解
- cookie跨域
- JavaScript random() 方法
- fiddler --- creation of the root certificate was not located 证书下载失败
- jQuery 事件
- android studio无法下载插件的解决办法
- 记个python 脚本笔记,click命令行模块实例
- android adb 控制手机