0

I was following GWT tutorial https://developers.google.com/web-toolkit/doc/2.1/tutorial/compile

And at the last step, which was compilation, I got a problem. When I successfully compiled the application, and when I clicked on the index html using chrome, all it showed was the static elements written inside the html file, not the dynamic contents.

However, I found it worked under safari.

I found the older version of the same tutorial https://developers.google.com/web-toolkit/doc/1.5/tutorial/compile which says that to test the web mode after compilation, a default browser is needed, for my Mac, it's safari.

GWT version: 2.5.1

I'm wondering why this happened? Any solution? Will it happen when I put it to the server?

Thanks in advance!

4

1 回答 1

4

GWT apps (by default) can't be run from the filesystem, they must be served by an HTTP server.

The reason is that the GWT app runs in an iframe, and two file:// URLs are considered different origins (for security reasons), so the iframe cannot communicate with the host page.

Try adding <add-linker name="xsiframe"/> to your *.gwt.xml (no guarantee though)

于 2013-04-03T15:05:53.967 回答