获取 项目路径

<%
    String path = request.getContextPath();   //返回值: /project_name
//同 ${pageContext.request.contextPath}
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; //返回值: http://localhost:8080/project_name/ %>

<head>
  <base href="<%=basePath%>">
</head>
原文地址:https://www.cnblogs.com/scmath/p/10020523.html