静态资源映射 访问除了static template外的文件
作者:互联网
编译一个config配置类
@Slf4j @Configuration public class WebMvcController extends WebMvcConfigurationSupport { // 静态资源映射,访问backend和front包下资源 @Override protected void addResourceHandlers(ResourceHandlerRegistry registry) { log.info("开始静态资源映射"); registry.addResourceHandler("/backend/**").addResourceLocations("classpath:/backend/"); registry.addResourceHandler("/front/**").addResourceLocations("classpath:/front/"); } }
标签:映射,静态,classpath,static,registry,template,front,backend 来源: https://www.cnblogs.com/Sun-fish/p/16437109.html