在开发spring boot项目的时候突然不能加载静态资源
我操
解决方法
在application.yml中配置静态资源路径
spring:
datasource:
username: root
password: guet2018
url: jdbc:mysql://localhost:3306/gaode_navigation?useUnicode=true&characterEncoding=utf-8&useSSL=true&serverTimezone=UTC
driver-class-name: com.mysql.cj.jdbc.Driver
thymeleaf:
cache: false
prefix: classpath:/templates/
suffix: .html
encoding: UTF-8
content-type: text/html
mode: HTML5
web:
resources:
static-locations: classpath:/templates/