开发者

How to redirect in gwt client?

开发者 https://www.devze.com 2023-01-26 02:14 出处:网络
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?

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

精彩评论

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