swagger2 报404

@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

posted @ 2022-09-29 17:58  jiduoduo  阅读(31)  评论(0编辑  收藏  举报