vaadin 7 URL parameter

一个人想着一个人 提交于 2019-12-03 13:37:20

The reason for this behavior is that UI.init is invoked from a request that is not always made to the same URL that was used to load the application. This is especially the case when embedding the UI instead of serving it as a standalone application.

The UI init request (named "browser details request" in some parts of the code) is by default sent to the same URL that was used to load the page. This does obviously not work when embedding as there is not Vaadin servlet mapped to that URL, so instead you have to define a browserDetailsUrl to to tell where the request should be sent.

v-loc that you observe is internally used to initialize the value returned by Page.getLocation().

To solve your particular problem, I would suggest one of these options:

  1. Dyncamically generate browserDetailsUrl to include the desired parameter as a query parameter, e.g. "browserDetailsUrl": "VAADIN?code=erefdvdfgftf".
  2. Extract the value from Page.getLocation().getQuery(). This is slightly less ugly than using the v-loc that you discovered as it doesn't rely on any implementation details.

It should work with: request.getParameter("code").

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!