springboot+thymeleaf 访问静态资源解决(static)
第一步:pom.xml-必须有这个
org.springframework.boot spring-boot-starter-thymeleaf第二步:application.properties
spring.mvc.static-path-pattern=/static/**
访问js路径就是:
http://localhost:8081/static/js/jquery.min.js
界面html里面引用路径
-----------------------------原来我用的是2.1.3 改成 2.0.2一切都解决了(/static/也不用加了)-----------------------------------------------
org.springframework.boot
spring-boot-starter-parent
2.0.2.RELEASE