springboot中如何实现默认静态路径
作者:暮色微凉
时间:2023-05-13
浏览:3
类ResourceProperties.classprivatestaticfinalString[]CLASSPATH_RESOURCE_LOCATIONS=newString[]{"classpath:/META-INF/resources/","classpath:/resources/","classpath:/static/","classpath:/public/"};privateString[]staticLocations;publicResourceProperties(){this.
本文目录
类ResourceProperties.class
private static final String[] CLASSPATH_RESOURCE_LOCATIONS = new String[]{"classpath:/META-INF/resources/", "classpath:/resources/", "classpath:/static/", "classpath:/public/"};
private String[] staticLocations;
public ResourceProperties() {
this.staticLocations = CLASSPATH_RESOURCE_LOCATIONS;
this.addMappings = true;
this.chain = new ResourceProperties.Chain();
this.cache = new ResourceProperties.Cache();
}根据构造方法可知, staticLocations等于默认的CLASSPATH_RESOURCE_LOCATIONS, 也即"classpath:/META-INF/resources/", "classpath:/resources/", "classpath:/static/", "classpath:/public/"
classpath即为我们如下图所示的resource文件夹

作者最新文章
如何正确使用夸克网盘前缀格式?夸克网盘前缀使用教程
2026-11-24 09:36
抖音官方充值链接及入口指南
2026-11-23 10:24
AO3防走失官网链接2025手机版入口
2026-11-22 16:21
抖音搜索app是做什么的 抖音搜索app收费吗
2026-11-19 15:26
腾讯会议本地录制和云录制怎么选 保存路径设置
2026-11-18 17:23
下一篇:
SpringBoot启动原理是什么
热门文章
更多
精品专题
更多
Mac软件
更多
WINDOWS
更多
























