Really simple question: From within GWT I want to forward the user away from my GWT page to a certain URL. What is the best way to do this?
+3
A:
You could create a native method:
public static native void setWindowHref(String url)/*-{
$wnd.location.href = url;
}-*/;
This would set the current browser URL to be the address you specify.
Alternative with GWT's API (thanks, Hilbrand):
Window.Location.assign(url);
Phill Sacre
2010-03-26 09:02:15
perfect! thanks!
Epaga
2010-03-26 09:59:17
GWT already has a static method for this: Location.assign(String newURL) (in the Window class).
Hilbrand
2010-03-26 10:38:28
Ha! Even better @Hilbrand :D
Epaga
2010-03-26 10:42:20
+1
A:
Try this:
public static native void leavePage() /*-{
$wnd.location.href = "http://www.certainurl.com/";
}-*/;
systempuntoout
2010-03-26 09:04:01