molleman
molleman

Reputation: 2946

question on redirecting in gwt

i am using gwt to create a web application.

when a user presses the logout button, i want to be able to refresh the page(or basically redirect to the homepage)as my GWT application runs only on one html page.

what is the programmatic code to do this?

Upvotes: 4

Views: 3614

Answers (2)

markovuksanovic
markovuksanovic

Reputation: 15906

You could use

//redirect the browser to the given url. Native method

public static native void redirect(String url)/*-{
      $wnd.location = url;
  }-*/;

//Example call

redirect("http://www.example.com/");

Upvotes: 0

Jason Hall
Jason Hall

Reputation: 20920

You want to use Window.Location.assign() to tell the browser to go to a URL, such as a URL pointing to a servlet that logs out the user.

Upvotes: 9

Related Questions