开发者

How to redirect in gwt client?

I'd like redirect to another page when I login successfully, but do not know how. I searched stackoverflow, How to redirect a GWT app from the client sid开发者_运维技巧e? but this solution seems not work.

Anyone has experience on this ? Thanks


Window.Location.replace(newURL)


You can use

Window.Location.assign("your url with parameter if needed"); 


I suggest to make the login happen without GWT. That way the browser can offer to remember the password for the user. If the login was succesful, redirect the user to the GWT host page url.


You can accomplish this with a simple JSNI method:

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

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜