Hard update in GWT

Using the Google Web Toolkit, I would like to encode the equivalent of hard refresh (control + F5) .

I do not believe (or know) if GWT Window.Location will work.

 import com.google.gwt.user.client.Window.Location; Window.Location = currentPage; // I don't think it'll be hard refresh 
+8
java web-applications gwt
source share
3 answers

To reload the current page, you need to call the Window.Location.reload () method.

Reloads the current browser window. All GWT status will be lost.

Or you can even specify your own JSNI (below as todo), because force reload is false by default ):

  public static native void forceReload() /*-{ $wnd.location.reload(true); }-*/; 
+9
source share

According to https://developer.mozilla.org/en-US/docs/DOM/window.location#Methods you need to call window.location.reload(true) to force the current page to reload.

Unfortunately, GWT only wraps window.location.reload() through window.location.reload() , and the browser can retrieve the page from the cache or from another get. This is done to solve most interserver solutions.

Never tried, but you should be able to use the following.

 public static native void reload(boolean force) /*-{ $wnd.location.reload(force); }-*/; 
+4
source share

For the reload gwt page, you have two options:

1) Window.Location.reload ();

Reloads the current browser window. All GWT status will be lost.

2) Window.Location.replace ("newurl");

Replaces the current URL with a new one. All GWT status will be lost. In the browser history, the current URL will be replaced with the new URL.

+1
source share

All Articles