GWT Multiple html pages and navigation

Hi, firstly, I want to mention what I know about an ajax based application and reusing the same page.

The requirement here is that I want to have two separate pages for login and another for the main application. Now this is not because I just want it, but because I have very different layouts on two pages, which I prefer to combine with the html and css elements directly on the page, and then put divs in dynamic html for gwt to fill.

Even in the case of myfaces, I did not see the application with the same login page and the main page of the application. In any case, the problem I am facing says that I have two pages

Login.html with div: div id = "login"

Main.html with div: div id = "main"

I declared both of them in my welcome file list in web.xml. Now I start from the login page, filling out the "login" div with gwt widgets and with one click I use the following jsni code to redirect to "/Main.html?gwt. codesvr = 127.0.0.1: 9997 "

private native void gotoURL (String url) / - {$ Wnd.location.href = URL; } - /;

and then tries to populate the "main" div. But the behavior that I noticed is that the application calls the entry point again, and it does not find any element as an “input” and gives NPE. Is there any way to do this? also get rid of "? gwt.codesvr = 127.0.0.1: 9997"?

thank

+3
source share
1 answer

-, ?gwt.codesvr=... - ( gwt). URL- (, "Main.html" ). , ( ), URL- ( , Login.html Main.html)

-, , , - html , div , html- . 2 UiBinders - , - URL- ( GWT ), , . , GWT . http://code.google.com/webtoolkit/doc/latest/DevGuideCodingBasicsHistory.html#stateful

+2

Source: https://habr.com/ru/post/1785929/


All Articles