Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
235 views
in Technique[技术] by (71.8m points)

google chrome - After compiling using GWT, only static elements shown in the page

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!

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

56.8k users

...