<script type="text/javascript" src="${root}/static/js/jquery-3.5.1.js"></script>
<script ype="text/javascript" src="<c:url value="${root}/static/js/jquery-3.5.1.js"></c:url>">
<script type="text/javascript" src="${pageContext.Request.contextPath}/static/js/jquery-3.5.1.js"></script>
- 这三种引用方式都没有用,在网上也查找了各种资料
- 直到用了下面这种写法
<script type="text/javascript" src="<%=request.getContextPath()%>/static/js/jquery-3.5.1.js"></script>
- 就没有报错了
- 但是${pageContext.Request.contextPath}和<%=request.getContextPath()%>是同一种意思
- 不知道为什么换了后一种写法就不报错了
- 希望知道的大佬告知一下,在此谢谢了