Vaadin 8 Spring 使用 Spring MVC 启动 QuickTickets 仪表板

Vaadin 8 Spring Boot QuickTickets Dashboard with Spring MVC

我正在尝试根据我的项目需要调整 Vaadin Spring Boot QuickTickets Dashboard 示例。一切正常,除了我无法访问另一个(不是 Vaadin UI)URL。例如,我有 Spring Boot Actuator 端点 - http://localhost:8080/actuator/health but when I try to access it, the application wrongly redirects me to http://localhost:8080/actuator/health#!dashboard. Pretty much the same behavior with my custom login page(not Vaadin UI) - http://localhost:8080/login。我也访问不了。

如何正确设置 Vaadin 以便能够访问 Spring Boot Actuator 端点和我的自定义登录页面?

您需要将 servlet 映射到不同的路径。我认为问题是 Vaadin-Servlet 映射到 / 正在处理所有请求。

向您添加以下内容 application.properties 应该可以解决问题。

vaadin.servlet.urlMapping = /myapp/*

当然,应用程序的 URL 会相应更改。