我是靠谱客的博主 怡然黑夜,这篇文章主要介绍jsp获取url路径,现在分享给大家,希望可以做个参考。

假如请求的URL是 http://localhost:8080/test/index.jsp

//输出:http
request.getScheme()
//输出: localhost
request.getServerName()
//输出: 8080
request.getServerPort()
//输出: /test
request.getContextPath()
//输出: /index.jsp
request.getRequestPath()
//输出:
/test/index.jsp
request.gerRequestURI()
//输出: http://localhost:8080/test/index.jsp
request.getRequestURL()
//输出:E:apache-tomcat-8.0.10webappstest
request.getRealPath("")

最后

以上就是怡然黑夜最近收集整理的关于jsp获取url路径的全部内容,更多相关jsp获取url路径内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(46)

评论列表共有 0 条评论

立即
投稿
返回
顶部