对于 /** 的请求的映射
以“/**”访问当前项目的任何资源,都会默认从以下的静态资源文件夹去找映射
"classpath:/META‐INF/resources/",
"classpath:/resources/",
"classpath:/static/",
"classpath:/public/"
"/":当前项目的根路径
对于使用thymeleaf
只需要把HTML页面放在classpath:/templates/下即可,这样就会进行自动渲染。
@ConfigurationProperties(prefix = "spring.thymeleaf")
public class ThymeleafProperties {
private static final Charset DEFAULT_ENCODING = Charset.forName("UTF‐8");
private static final MimeType DEFAULT_CONTENT_TYPE = MimeType.valueOf("text/html");
public static final String DEFAULT_PREFIX = "classpath:/templates/";
public static final String DEFAULT_SUFFIX = ".html";
拦截器放行静态资源
静态资源如下: