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


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM