从这个链接我看到了For every instance of a RAP UI, a separate UISession is created. That means that when a user accesses an entry point, that’s a new UISession. When the user reloads the page in the browser, that’s also a new UISession.
在我的应用程序中,当浏览器刷新时(通常通过按 F5 或关闭浏览器并再次打开)并从 MAT(内存分析器工具)报告中,我看到创建了一些调用 UISessionImpl 的内容与刷新浏览器的时间一样多。这意味着创建了新的 UISession 但旧的会话仍然存在。
所以我的问题是“每次浏览器刷新时如何清除会话?”。
编辑
我的代码:
RWT.getUISession(myDisplay).exec(new Runnable() {
@Override
public void run() {
RWT.getRequest().getSession().setMaxInactiveInterval(1);
}
});