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文件夹

作者最新文章
PDF怎么按页拆成单独文件?PDF按页拆分后怎么命名
2026-11-03 18:00
长网页转PDF怎么避免断图?网页转PDF怎么设置分页
2026-11-01 09:31
夸克资源库蓝光资源每日更新经典电视剧全集
2026-10-30 11:54
会声会影怎么导入音频 支持格式及步骤
2026-10-29 12:23
WPS表格常用功能实操:从录入到排序筛选的完整流程
2026-10-29 09:57
下一篇:
SpringBoot启动原理是什么
热门文章
更多
精品专题
更多
Mac软件
更多
WINDOWS
更多
























