0
点赞
收藏
分享

微信扫一扫

Spring Boot thymeleaf 引入js css 报错404 找不到文件问题


Spring Boot thymeleaf 引入js css 报错404 找不到文件问题

 

在application.properties中加入:

spring.mvc.static-path-pattern=/**

spring.resources.static-locations = classpath:/templates/

 

html中引入

<script th:src="@{/jquery.js}"></script> 或
<script src="jquery.js"></script>

jquery.js在当前目录(目录resources/templates/jquery.js , html也在当前目录)

举报

相关推荐

0 条评论