LWM
@Configuration
public class WebConfig extends WebMvcConfigurationSupport {

    @Override
    protected void addResourceHandlers(ResourceHandlerRegistry registry) {
        // TODO Auto-generated method stub
        registry.addResourceHandler("/static/**").addResourceLocations("file:E://contract/");
    }
}

 

加了devtools依赖的会报错:CONDITION EVALUATION DELTA

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-devtools</artifactId>
            <scope>runtime</scope>
            <optional>true</optional>
        </dependency>

 

 

(6条消息) SpringBoot访问静态资源出现404_一棵小白菜#的博客-CSDN博客_springboot访问静态资源404

 

posted on 2023-02-04 16:18  Lwmm  阅读(29)  评论(0编辑  收藏  举报