Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/visual-studio-code/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Session 如何重新启动Vaadin会话?_Session_Vaadin_Restart - Fatal编程技术网

Session 如何重新启动Vaadin会话?

Session 如何重新启动Vaadin会话?,session,vaadin,restart,Session,Vaadin,Restart,注销后,我需要使会话无效并立即启动一个新会话。我使用了这个函数 VaadinSession.getCurrent().getSession().invalidate(); 几秒钟后,出现一个红色框“会话已过期”。用户必须单击它或按F5。如何避免它并立即显示新的会话页面? 在javascript中很容易: document.location='/'; 如何在瓦丁做同样的事?该行为应与重新启动资源管理器后首次访问页面时的行为相同。在我的项目中,我使用以下方法: Page.getCurrent()

注销后,我需要使会话无效并立即启动一个新会话。我使用了这个函数

VaadinSession.getCurrent().getSession().invalidate();
几秒钟后,出现一个红色框“会话已过期”。用户必须单击它或按F5。如何避免它并立即显示新的会话页面? 在javascript中很容易:

document.location='/';

如何在瓦丁做同样的事?该行为应与重新启动资源管理器后首次访问页面时的行为相同。

在我的项目中,我使用以下方法:

Page.getCurrent().setLocation( "/" );
VaadinSession.getCurrent().close();

在我的项目中,我使用以下方法:

Page.getCurrent().setLocation( "/" );
VaadinSession.getCurrent().close();
工作原理:page.setLocation(VaadinServlet.getCurrent().getServletConfig().getServletContext().getContextPath())工作原理:page.setLocation(VaadinServlet.getCurrent().getServletConfig().getServletContext().getContextPath())