Togglz 管理控制台和 Spring 启动 2

Togglz Admin Console and Spring Boot 2

我正在尝试在我的 Spring Boot 2.0.0.M6 应用程序中启用 Togglz 控制台。

我添加了以下 Maven 依赖项:

<!-- Togglz Admin Console -->
<dependency>
    <groupId>org.togglz</groupId>
    <artifactId>togglz-console</artifactId>
    <version>2.5.0.Final</version>
</dependency>

并添加了以下内容application.properties

server.port: 8080
server.servlet.context-path= /api
#Togglz
togglz.console.enabled=true
togglz.console.path=/togglz-console
togglz.console.secured=true
togglz.console.feature-admin-authority=ROLE_1

现在我无法访问 http://localhost:8080/api/togglz-console,出现以下错误:

org.thymeleaf.exceptions.TemplateInputException: Error resolving template "error", template might not exist or might not be accessible by any of the configured Template Resolvers
    at org.thymeleaf.engine.TemplateManager.resolveTemplate(TemplateManager.java:870) ~[thymeleaf-3.0.8.RELEASE.jar:3.0.8.RELEASE]
    at org.thymeleaf.engine.TemplateManager.parseAndProcess(TemplateManager.java:607) ~[thymeleaf-3.0.8.RELEASE.jar:3.0.8.RELEASE]
    at org.thymeleaf.TemplateEngine.process(TemplateEngine.java:1098) [thymeleaf-3.0.8.RELEASE.jar:3.0.8.RELEASE]
    at org.thymeleaf.TemplateEngine.process(TemplateEngine.java:1072) [thymeleaf-3.0.8.RELEASE.jar:3.0.8.RELEASE]
    at org.thymeleaf.spring5.view.ThymeleafView.renderFragment(ThymeleafView.java:355) [thymeleaf-spring5-3.0.8.RELEASE.jar:3.0.8.RELEASE]
    at org.thymeleaf.spring5.view.ThymeleafView.render(ThymeleafView.java:188) [thymeleaf-spring5-3.0.8.RELEASE.jar:3.0.8.RELEASE]

除了 Togglz 管理控制台问题,Togglz 功能的其他一切都正常。如何正确启用 Togglz 管理控制台?

为了使其正常工作,您应该添加以下内容 属性:

togglz.console.use-management-port=false