首页 > 其他 > 详细

路径问题

时间:2017-10-10 15:23:09      阅读:269      评论:0      收藏:0      [点我收藏+]

<%
 String appContext = request.getContextPath();
 String basePath = request.getScheme()+"://"+request.getServerName()+":"+ request.getServerPort() + appContext; 
%>

request.getContextPath()

返回当前项目的名称的路径  /waf

request.getScheme();
返回的协议名称,默认是http

request.getServerName()
返回的是你浏览器中显示的主机名,你自己试一下就知道了

getServerPort()
获取服务器端口号

路径问题

原文:http://www.cnblogs.com/zwy008/p/7645482.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!