【问题标题】:how to go to non-gwt page from gwt app如何从 gwt 应用程序转到非 gwt 页面
【发布时间】:2012-03-30 17:03:52
【问题描述】:

我有 gwt 应用程序,如果用户身份验证失败,它会将用户踢出登录页面,这是一个非 gwt 页面,我可以使用什么功能在客户端进行重定向?

这是我的代码:

    userService.getCurrentUser(new AsyncCallback<User>() {
        public void onFailure(Throwable exception) {
            Window.alert(exception.getMessage());
            GWT.log("getCurrentUser failed", exception);

            //go to home.html, how?

        }

        public void onSuccess(User result) {        
            m_eventBus.fireEvent(new LoginEvent(result));
        }
    });

谢谢!

【问题讨论】:

    标签: gwt


    【解决方案1】:

    尝试Window.Location.assign(url)Window.Location.replace(url),具体取决于您希望更改的页面如何影响浏览器历史记录。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2011-04-06
      • 2013-04-17
      • 2011-03-12
      • 2011-02-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多