首页 > 编程语言 > 详细

springboot 默认静态路径

时间:2019-11-07 23:27:12      阅读:96      评论:0      收藏:0      [点我收藏+]

springboot 默认静态路径

代码如下所示
类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文件夹
技术分享图片

springboot 默认静态路径

原文:https://www.cnblogs.com/Draymonder/p/11816086.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!