您好,欢迎访问一九零五行业门户网

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中如何实现默认静态路径的详细内容。
其它类似信息

推荐信息