@Configuration public class CommonConfig extends WebMvcConfigurationSupport{ @Override public void addResourceHandlers(ResourceHandlerRegistry registry) { registry.addResourceHandler("/**").addResourceLocations( "classpath:/static/"); registry.addResourceHandler("swagger-ui.html").addResourceLocations( "classpath:/META-INF/resources/"); registry.addResourceHandler("/webjars/**").addResourceLocations( "classpath:/META-INF/resources/webjars/"); super.addResourceHandlers(registry); } }
加上以上配制就可以了。
之前的https://www.cnblogs.com/jiduoduo/p/15638916.html
标签:addResourceHandler,classpath,swagger2,404,registry,addResourceLocations From: https://www.cnblogs.com/jiduoduo/p/16742509.html