xiaoymin / blog-comments

blog-comments
0 stars 0 forks source link

swagger-bootstrap-ui SpringBoot访问doc.html页面404 #56

Open xiaoymin opened 5 years ago

xiaoymin commented 5 years ago

http://www.xiaominfo.com/swagger-bootstrap-ui/springboot-404.html

swagger-bootstrap-ui是springfox-swagger的增强UI实现,为Java开发者在使用Swagger的时候,能拥有一份简洁、强大的接口文档体验

xiaoymin commented 5 years ago

如果使用以上方式不行的话,试试将classpath*替换为classpath

比如这样:

public void addResourceHandlers(ResourceHandlerRegistry registry) {
    registry.addResourceHandler("doc.html").addResourceLocations("classpath:/META-INF/resources/");
    registry.addResourceHandler("/webjars/**").addResourceLocations("classpath:/META-INF/resources/webjars/");
}