<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"
%>
输出:
<%=basePath%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"
%>
输出:
<%=basePath%>
转载于:https://www.cnblogs.com/lingtiaoti/p/9509284.html