加斜杠是绝对路径,基于http://localhost:8080/
不加斜杠是相对路径,基于当前文件
如果设置了basePath,就基于basePath
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<head>
<base href="<%=basePath%>">
</head>
绝对路径:${pageContext.request.contextPath}取出部署的应用程序名