I’m new in using GWT.
When I heard about GWT I thought than I will be able to compile Java code to html+css+js files and can use it offline without any webserver. Now, when I’m reading how tos about starting with GWT I see that compiled GWT application has to be deployed before starting it in webbrowser.
Is any way to compile GWT to plain html files and run it in browser by simply clicking some html file?
Try adding the following to your
gwt.xml:The reason is that files loaded from the filesystem are all treated as if they came from different origins, so it’s really easy to be caught by the so-called same-origin policy.
By default (using the
stdlinker), GWT outputs *.cache.html files that are loaded in aniframe, so, being from different origins, the code in theiframecannot talk to the HTML host page.Using the
xsiframelinker (or the now-deprecatedxslinker), GWT generates *.cache.js files that are loaded usingscripttags, which allows loading scripts cross-origins.See https://developers.google.com/web-toolkit/doc/latest/FAQ_Server#What_is_the_Same_Origin_Policy,_and_how_does_it_affect_GWT?