SpringBoot 中使用 Swagger2 出现 whitelabel page error 解决方法


今天使用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/
注意最后的斜杠/不能少

亲测好用 不用访问.html结尾的文件了

转载自 https://www.cnblogs.com/feily/p/14316532.html

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM