user468587
user468587

Reputation: 5031

how to go to non-gwt page from gwt app

i have gwt app that if the user fail the authentication, it kick the user out to login page, which is a non-gwt page, what the function that i can use to do the redirection on the client side?

here is my code:

    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));
        }
    });

Thanks!

Upvotes: 0

Views: 94

Answers (1)

Colin Alworth
Colin Alworth

Reputation: 18331

Try Window.Location.assign(url), or Window.Location.replace(url), depending on how you want the changing page to affect browser history.

Upvotes: 1

Related Questions