springboot中如何实现默认静态路径
作者:暮色微凉
时间:2023-05-13
浏览:2
类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-10-13 13:20
漫蛙漫画官方免费漫画入口
2026-10-13 13:19
漫蛙漫画网页版入口
2026-10-13 13:19
最新漫蛙链接合集2026
2026-10-13 13:16
漫蛙manwa2登录网址
2026-10-13 13:14
下一篇:
SpringBoot启动原理是什么
热门文章
更多
精品专题
更多
Mac软件
更多
WINDOWS
更多

































