假如请求的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路径内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复