spring-boot - 在使用 Thymeleaf 作为视图技术的应用程序中访问 swagger-ui.html
问题描述
我正在使用thymeleaf - 模板、spring security、swagger 在 java 中开发一个 web 应用程序,用于应用程序中其余端点的 api 文档。一切正常,除了无法访问swagger-ui.html页面
我已经添加了过滤器来忽略 Spring Security 中的招摇端点。我可以v2/api-docs
在浏览器中以 json 格式访问链接。但是,当我访问时出现以下错误swagger-ui.html
Whitelabel Error Page
This application has no explicit mapping for /error, so you are seeing this as a fallback.
Wed Jan 02 13:32:46 EAT 2019
There was an unexpected error (type=Internal Server Error, status=500).
Error resolving template "swagger-ui", template might not exist or might not be accessible by any of the configured Template Resolvers
解决方案
推荐阅读
- java - 让 springboot 路由到您的子域,而不是 localhost
- python - 熊猫根据另一列的值增加计数列
- php - 如何从表行的引导程序 4 下拉列表中获取 id 值?
- javascript - 我如何以更优雅的方式保存对象
- php - 在 laravel 中从视图中查找数组索引
- python - 有没有办法声明一个函数应该使用调用者的范围?
- tensorflow - 如何使用 Horovod 在分布式环境中运行 TensorFlow 2?
- java - 如何终止由于 Socket.accept() 而被阻塞太久的线程?
- reactjs - 部署的 Heroku 应用在桌面上运行良好,但在移动设备上只有空白屏幕
- reactjs - 通过函数在子组件中向下传递变量的道具类型应该是什么