首页 > 解决方案 > 在使用 Thymeleaf 作为视图技术的应用程序中访问 swagger-ui.html

问题描述

我正在使用thymeleaf - 模板spring securityswagger 在 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

标签: spring-bootspring-securitythymeleafswagger-ui

解决方案


推荐阅读