quarks
quarks

Reputation: 35346

GWT showing blank page.

my GWT app is designed to be multipage. And separated into modules. So far all other modules works, except for my 'login' module.

I don't understand why when I access http://127.0.0.1:8888/login.html?gwt.codesvr=127.0.0.1:9997 I get a blank page.

LoginEntryPoint:

public void onModuleLoad() {
    GWT.log("Loading module");
     if (!Window.Location.getPath().toLowerCase().endsWith("login.html")) { 
         return;
     }
     RootPanel.get().add(new Button("Test"));
}

And in the login.html file:

<script type="text/javascript" language="javascript" src="login/login.nocache.js"></script>

and finally in the Login.gwt.xml:

<entry-point class='com.mygwtapp.client.LoginEntryPoint' />

How to fix this kind of situation?

Upvotes: 1

Views: 3474

Answers (4)

adoalonso
adoalonso

Reputation: 325

If you are running in hosted mode, this if if (!Window.Location.getPath().toLowerCase().endsWith("login.html")) { is true, so no button should appear. Try changing the "endsWith" by "contains" method

Upvotes: 0

Elijah Tate
Elijah Tate

Reputation: 1

This problem was happening to me, and I figured out that it was all because I had Buttons in a FormPanel. As soon as I removed them from the FormPanel everything showed up again. I am not sure where exactly you were sticking the button up there, but you might want to try removing the button out of the equation, trying another type of panel and some text, and see if it shows up without the button present.

Upvotes: 0

Youans
Youans

Reputation: 5091

Make sure also when you compile the project Remember to add the new module to be compiled

Right Click on the Project >> Google >> Gwt Compile >> Add (add your new module)

Upvotes: 3

Colin Alworth
Colin Alworth

Reputation: 18356

Does your log statement happen? If not, is the login.cache.js file even loading (use firebug or the like to check)? If so, can you set a breakpoint on that log statement and step forward, see where it gets to?

And is there anything shown when you run in web mode?

If the login.nocache.js isn't loading, make sure you added rename-to="login" in the module tag, make sure it is actually being compiled, etc

Upvotes: 0

Related Questions