我已经添加了
<mvc:resources mapping="/webapp/**" location="/webapp/" />
<mvc:default-servlet-handler />
在我的 dispatch-servlet.xml 中 我的文件夹层次结构是 enter image description here
并在 index.jsp 中声明
<spring:url value="/webapp/resources/js/bootstrap.min.js" var="bootstrapJS" />
<script src ="${bootstrapJS}" type="text/javascript"></script>
谁能说出实际问题出在代码或文件夹层次结构上
最佳答案
您好,您是否在 index.jsp 的顶部包含了标签,它看起来像这样。 <%@ taglib prefix="spring"uri="http://www.springframework.org/tags"%>
关于SpringMVC - 无法访问 index.jsp 中的 JS 和 CSS 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40003568/