JSP 不能访问外部css js

    <%
        String path = request.getContextPath();

        String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
    %>
        <!-- base需要放到head中 -->
        <base href=" <%=basePath%>">

 把这段代码放在head标签中就行了 亲测有效

 

posted on 2019-04-09 18:34  优⃢&#128065;ܫ&#128065;⃢秀  阅读(311)  评论(0编辑  收藏  举报

导航