jsp获取url路径的方法分析
本文实例讲述了jsp获取url路径的方法。分享给大家供大家参考,具体如下: 如果你请求的URL是 http://localhost:8080/demo/Index.jsp request.getScheme() //输出:http request.getServerName() //输出: localhost request.getServerPort() //输出: 8080 request.getContextPath() //输出: /demo request.getRequestPath() //输出: /Index.jsp request.gerRequestURI() /
下载地址
用户评论