<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<base href="<%=basePath%>">是一个基链接,只能应用于<head></head>标签内,那么页面上的所有相对路径文件的链接都是在前面加上这个基础链接指向的地址。
本文介绍了<base>标签的使用方法及其作用范围。通过设置基链接,可以为页面中的所有相对路径文件统一前缀,简化链接管理。适用于前端开发者。
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<base href="<%=basePath%>">是一个基链接,只能应用于<head></head>标签内,那么页面上的所有相对路径文件的链接都是在前面加上这个基础链接指向的地址。
302

被折叠的 条评论
为什么被折叠?