Question on production mode/ compilation

14 views
Skip to first unread message

neicke

unread,
Sep 20, 2011, 7:28:37 AM9/20/11
to Google Web Toolkit
Hello everyone,

i have a GWT project which is working fine in development mode and
compiles successfully. But when i open the html-file I don't see the
UI created with GWT. The javascript does not load i guess. I tried
both Firefox and Chrome.
I renamed my project recently, what might got me into trouble.
How should i proceed to get my project running in my browser?

Alexandre Dupriez

unread,
Sep 21, 2011, 7:58:13 AM9/21/11
to Google Web Toolkit
Check that the script in your HTML host page refers to the correct
Javascript file generated by GWT.
e.g.:

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

in the <head> section of the HTML.

Thomas Broyer

unread,
Sep 21, 2011, 9:39:54 AM9/21/11
to google-we...@googlegroups.com
GWT defaults to loading code from HTML files in an iframe that works kind of like a "sandbox". The iframe's content has to be from the same "origin" as the host page for them to be able to communicate with each others (see "Same Origin Policy").
When loaded from the filesystem, the iframe will have a different "origin" as the host page, so it'll fail.

You might try using the xsiframe linker, which loads JS files, instead of HTML ones (add <add-linker name="xsiframe"/> to your gwt.xml). Otherwise, you have to serve your HTML host page through a web server.
Reply all
Reply to author
Forward
0 new messages