首页 > 编程语言 > 详细

springboot+thymeleaf 访问静态资源解决(static)

时间:2019-03-07 11:23:22      阅读:2401      评论:0      收藏:0      [点我收藏+]

第一步:pom.xml-必须有这个

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>

第二步:application.properties

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


访问js路径就是:

http://localhost:8081/static/js/jquery.min.js

界面html里面引用路径
<script src="/static/js/jquery.min.js"></script>
 

springboot+thymeleaf 访问静态资源解决(static)

原文:https://www.cnblogs.com/duanqiao123/p/10488031.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!