zoukankan      html  css  js  c++  java
  • Springboot 默认静态路径

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

  • 相关阅读:
    Hbase JavaApi
    面向对象特征之继承
    重写(Override)与重载(Overload)
    数组排序
    EL表达式
    java异常
    业务代码与非业务代码
    设计思想之高内聚低耦合
    JDBC实现动态查询
    枚举
  • 原文地址:https://www.cnblogs.com/Draymonder/p/11816086.html
Copyright © 2011-2022 走看看