SpringBoot2.x 同个文件的加载顺序,静态资源文件

it2022-05-24  69

Spring Boot 默认会挨个从 META/resources > resources > static > public 里面找是否存在相应的资源,如果有则直接返回。

 

默认配置:

spring.resources.static-locations = classpath:/META-INF/resources/,classpath:/resources/,classpath:/static/,classpath:/public/

 

建议将静态资源和代码分离,将静态资源文件存储在CDN

转载于:https://www.cnblogs.com/Mblood/p/9673006.html


最新回复(0)