开发者

GWT History token rewriting

I want to do histo开发者_运维技巧ry token rewriting. Don't know its possible or not. e.g. If my application URL is http://localhost:8080/myapp/#login which contain 'login' as history token. Is it possible to rewrite the URL like http://localhost:8080/myapp/user/login.

Or is it possible to remove '#' from history token?


The # token has special meaning in an URL. The browser interprets everything before the # token as the page to load, and everything after the # as additional information for on the page. This means if something is changed in the URL after the # token, the webpage is not reloaded, but it does create a browser history item. GWT uses this to create new history items, while not reloading the page.

If you would rewrite the URL from #login to /user/login you would instruct the browser to reload the page, which means the whole GWT page is reloaded and all state information is reset. This is probably not what you want.

So the short answer is, although it's technically possible, it will change the behavior from a one page website to a multi-page website that reloads every time the history changes, and that's probably not something you want.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜