vaadin从23.0.9升级到23.1.0路由行为 / sw.js的行为变化

发布于 2025-02-08 00:41:53 字数 502 浏览 1 评论 0原文

我有一个应用程序,该应用程序既有休息端点,又有Vaadin UI。我有两个servlet映射:

  • vaadinservlet- /*
  • customservlet- /rest/v1/v1/*

with Vaadin版本23.0.9,无论我是否调用/rest/v1 /*路径,它只会允许我的请求转到CustomServlet。

使用版本23.1.0,这不再起作用。基本上,当我现在调用/rest/v1/*路径后,在打开应用程序后,Vaadin Flow Router似乎会截获请求并给出错误。这是由于SW.JS文件的生成方式似乎会改变。即,如果我在应用程序的23.1.0实例中手动将其取消注册,则它确实允许直接请求/rest/v1/*传递。

但是,一旦我到达主应用程序页面,而SW.JS有机会安装,它就会停止工作。

这是新版本的回归 /错误吗?

I have an application that hosts both a REST endpoint and a Vaadin UI. I have two Servlets mapped:

  • VaadinServlet - /*
  • CustomServlet - /rest/v1/*

With version 23.0.9 of Vaadin whether I invoked the /rest/v1/* path, it would simply allow my request to go through to the CustomServlet.

With version 23.1.0 this no longer works. Basically when I now invoke the /rest/v1/* path after having opened the application, the Vaadin Flow Router seems to intercept the request and gives an error. This is due it would seem to changes in how the sw.js file is generated. I.e. if I manually unregister it for the 23.1.0 instance of the application, it does allow a direct request to /rest/v1/* to pass-through.

However, once I hit the main application page and the sw.js gets a chance to install, it stops working.

Is this a regression / bug with the new version?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

为你鎻心 2025-02-15 00:41:53

我设法为此找到了解决方法。基本上,我设置了我的vaadin servlet:

@WebServlet(urlPatterns = {"/ui/*","/VAADIN/*"}, name = "configurationServlet", asyncSupported = true)
public class WebAppConfigurationServlet extends VaadinServlet
{
}

然后我所有的路线我都会丢弃ui/前缀。即,

@Route(value = "about", layout = AdminMainLayout.class)

而不是

@Route(value = "ui/about", layout = AdminMainLayout.class)

I managed to find a workaround for this. Basically I set up my Vaadin Servlet like:

@WebServlet(urlPatterns = {"/ui/*","/VAADIN/*"}, name = "configurationServlet", asyncSupported = true)
public class WebAppConfigurationServlet extends VaadinServlet
{
}

And then all my routes I just drop the ui/ prefix. I.e.

@Route(value = "about", layout = AdminMainLayout.class)

rather than

@Route(value = "ui/about", layout = AdminMainLayout.class)
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文