Swagger访问:Whitelabel Error Page。No mapping for GET /swagger-ui.html
2023-09-14 09:05:04 时间
在SpringBoot项目引入Swagger2后,在浏览器地址里输入地址:http://ip:port/swagger-ui.html 报错:
查看后台控制台,发现这样的错误:
经过分析发现由于项目中有配置注解类(@Configuration)继承了WebMvcConfigurationSupport,导致默认的Swagger静态资源被覆盖,而缺失了配置。
可在该继承配置类中,显式添加如下swagger静态资源:
registry.addResourceHandler("swagger-ui.html") .addResourceLocations("classpath:/META-INF/resources/"); registry.addResourceHandler("/webjars/**") .addResourceLocations("classpath:/META-INF/resources/webjars/");
打包部署重启 ,可以了
相关文章
- HTML入门学习笔记(二)
- 浏览器解析html全过程详解
- HTML渲染过程详解
- HTML应用程序(HTML App)
- [HTML 5] Add event listener once
- html实现带斜线的表头
- html 按钮的三种形式
- [HTML 5] Inserting DOM as String template insertAdjacentHTML
- [Recompose] Set the HTML Tag of a Component via a Prop using Recompose
- [AngularJS] Accessing Data in HTML -- controllerAs, using promises
- Html 标签的嵌套规则
- SAP CAP Fiori Elements 应用配置 UI 的两种方式以及自定义 index.html
- SAP UI5 应用 index.html 里 data-sap-ui-resourceroots 指令的含义和作用
- 如何用html实现树形结构
- UI component html code 查看工具
- Atitit 常见软件设计图纸总结 目录 1.1. ui原型图与html2 1.2. 业务逻辑 伪代码 各种uml图2 1.3. 总体设计图纸 结构图 层次图 架构图2 1.4. 业务逻辑
- atitit 需求条目的自动化生成原型html h5界面ui与解决方案
- SAP CAP Fiori Elements 应用配置 UI 的两种方式以及自定义 index.html
- Froala Editor HTML Editor Crack
- wkhtmltopdf:wkhtmltopdf(将html转换成pdf的利器)简介、安装、使用方法详细攻略
- 想使用 Kotlin DSL for HTML 来这样写前端的代码码?
- python 反扒技巧 爬虫失败的原因分析 html的学习 css java html dom bs4 xpath selenium js混淆加密 反混淆 ajaxs
- HTML CSS表格如何控制上下间距
- 用HTML创建表格
- HTML中 块级元素 如何转为 行内元素??
- HTML如何引入外部JS文件