SpringBoot 中使用 Swagger2 出现 whitelabel page error 解决方法
时间:2021-01-23 10:12:55
收藏:0
阅读:1823
今天使用Swagger最新版,在pom.xml引入
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>3.0.0</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>3.0.0</version>
</dependency>
其他弄好后,访问 http://localhost:8080/swagger-ui.html 出现如题错误。
解决方案如下:
替换pom.xml内容为
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-boot-starter</artifactId>
<version>3.0.0</version>
</dependency>
访问: http://localhost:8080/swagger-ui/
注意最后的斜杠/
不能少
原文:https://www.cnblogs.com/feily/p/14316532.html
评论(0)