how to pass from an entrypoint to another with GWT

2019-07-25 15:13发布

I want to developp a web application, but i have a problem in the creation of 2 web pages. I want to have an authentification page then i want to pass to the other one. I created 2 entrypoints and i want to call one page from the other. Anyone knows how to do it ?

2条回答
Animai°情兽
2楼-- · 2019-07-25 15:40

I am assuming that you have created 2 web pages with 2 modules(2 entry points) and html pages included the specific modules. From your first page after authentication you can use

Window.Location.replace("your page path to replace");

It will redirect to second page. Hope It will Help.

查看更多
Luminary・发光体
3楼-- · 2019-07-25 16:05

If you ask the question of "How do I implement a login page for my GWT application?", everyone just redirects you to this semi-complete article: "LoginSecurity FAQ", which only gives you half the solution. It talks about jBCrypt and the need to communicate sessionID's with every RPC call between the client and the server. However, it does not shed any light on many crucial aspects of the solution:

1) According to the author, checkWithServerIfSessionIdIsStillLegal() method is intended to either display a loginbox if sessionID is no longer legal or allow you access to the main application otherwise. But where do you place this method? Where is "right after your !EntryPoint begins execution"? Is it in a separate GWT application? Is it a different entry point in the same GWT application? Where do you physically call this method from?

2) Immediately relevant to 1 is: where does the loginbox live in this architecture? Again, is it in the same GWT application as the main part you're restricting access to? If so, is it specified as a separate entry point? Or is the LoginBox just a separate GWT Application that is responsible to redirect guests to the main application only if its checkWithServerIfSessionIdIsStillLegal() method returns true?

There are no examples or explanations available, which is quite frustrating.

查看更多
登录 后发表回答