Spring Boot开发web项目之静态资源放哪里?
先了解自动装配autoconfiguration
这些内容是spring boot天然集成好的框架
找到WebMvcAutoConfigration.java
方式1:webjars
webjars:前端的静态资源可以是jar包的方式
@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
if (!this.resourceProperties.isAddMappings()) {
logger.debug("Default resource handling disabled");
return;
}
Duration cachePeriod = this.resourceProperties.getCache().getPeriod();
CacheControl cacheControl = this.resourceProperties<