首页 > 代码库 > spring-boot 静态资源自定义配置

spring-boot 静态资源自定义配置

@Configuration
public class MyWebAppConfig extends WebMvcConfigurerAdapter {
    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        registry.addResourceHandler("/myResource/**").addResourceLocations("classpath:/myResource/");
        super.addResourceHandlers(registry);
    }    
}
复制代码

参考:http://www.cnblogs.com/chry/p/5877979.html

spring-boot 静态资源自定义配置