检测GWT中的刷新事件

mj5*_*527 6 gwt

我们需要检测Web应用程序的Refresh事件(f5)/重新加载.GWT中是否有可以检测到这种情况的事件?

谢谢,mj

hel*_*hod 8

添加窗口关闭处理程序:

HandlerRegistration registration = Window.addClosingHandler(new ClosingHandler() {
    void onWindowClosing(ClosingEvent event) {
        // call the server, or whatever
    }
});
Run Code Online (Sandbox Code Playgroud)

编辑

HandlerRegistration使用注销Handler,如果你不需要它了.