如下:resource下的html文件夹内的文件全是静态资源,可以直接访问了
@Configuration
public class MyWebAppConfigurer extends WebMvcConfigurerAdapter {
@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
registry.addResourceHandler("/html/**").addResourceLocations("classpath:/html/");
super.addResourceHandlers(registry);
}
}