工程是基于springboot2.2.8 前端页面展示是thymeleaf,遇到的问题就是static下的静态资源访问404。
解决方案一:yml配置文件中放行静态资源文件夹
spring:
thymeleaf:
cache: false
prefix: classpath/templates
suffix: .html
mvc:
static-path-pattern: /static/**
spring.mvc.static-path-pattern: /static/**这个就是放行静态资源文件夹
解决方案二:自定义配置放行static文件夹