【问题标题】:SpringMVC - cann't able to acces JS and CSS file in index.jspSpringMVC - 无法访问 index.jsp 中的 JS 和 CSS 文件
【发布时间】:2016-10-12 16:19:38
【问题描述】:

我已经添加了

<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>

任何人都可以告诉实际的问题是代码或文件夹层次结构

【问题讨论】:

    标签: spring spring-mvc tomcat servlets


    【解决方案1】:

    您好,您是否在 index.jsp 的顶部包含了标签,它看起来像这样。

    【讨论】:

      猜你喜欢
      • 2015-10-19
      • 2017-04-20
      • 1970-01-01
      • 1970-01-01
      • 2018-03-28
      • 2013-12-06
      • 2021-04-09
      • 2021-01-06
      • 1970-01-01
      相关资源
      最近更新 更多