jsp笔记----jsp常用的的获取项目的根路径

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

使用

<%=basePath %>


原文地址:https://www.cnblogs.com/tk55/p/7542310.html