문제

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?

도움이 되었습니까?

해결책

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

다른 팁

Try this:

public static native void leavePage() /*-{
   $wnd.location.href = "http://www.certainurl.com/";
}-*/;
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top