spring boot 加载静态文件
生活随笔
收集整理的這篇文章主要介紹了
spring boot 加载静态文件
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
spring boot 加載靜態(tài)文件
@Slf4j @Configuration public class WebMvcConfig extends WebMvcConfigurationSupport {@Overrideprotected void addResourceHandlers(ResourceHandlerRegistry registry) {log.info("開始進行靜態(tài)資源映射...");registry.addResourceHandler("/backend/**").addResourceLocations("classpath:/backend/");registry.addResourceHandler("/front/**").addResourceLocations("classpath:/front/");}}http://xxxx:8080/backend/index.html
總結
以上是生活随笔為你收集整理的spring boot 加载静态文件的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 百度文库的文档下载
- 下一篇: 在java中为什么_属性绑定到类型_方法