开发者

how to create url like example.com/account in gwt application

开发者 https://www.devze.com 2023-04-05 06:07 出处:网络
I need to create a few urls which for my gwt application. e.g currently login screen is http://127.0.0.1:8888/abc.html?gwt.codesvr=127.0.0.1开发者_运维问答:9997

I need to create a few urls which for my gwt application. e.g currently login screen is

http://127.0.0.1:8888/abc.html?gwt.codesvr=127.0.0.1开发者_运维问答:9997 http://example.com/abc.html?gwt.codesvr=127.0.0.1:9997

i want to change it to

http://127.0.0.1:8888/accounts http://example.com/accounts

so when user directly open this link

I have developed this applicatoin in gwt with jdbc

looking forward to your reply


I suggest you take a look at how GWT handles History. You can save states of your application by using History tokens(For ex: ../modulename#user1, ../modulename#user2) and by parsing these tokens you can direct your user to appropriate section of your application. Since GWT applications run on a single html page I beleive this would be the correct approach to implement your functionality. Last but not least these states are bookmarkable and supports browsers back button as well.

By the way about changing the Url, ?gwt.codesvr=127.0.0.1:9997 is added to the url in development mode and will not appear in production mode when you compile deploy your application.


Just create a subfolder named accounts and move the index.html file there. The webserver should not automatically serve the index.html file, when someone requests to see the folder.


You can create the history and add the token in them:

private static final String abc = "account";
History.newItem(abc ,true);
0

精彩评论

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

关注公众号