In part 1, I have already illustrated that the application can run in hosted mode on your local development machine but can also be deployed to a servlet container such as tomcat. This makes the project available under the URL for the servlet package. In below picture, the name of the package is zzSampleGWT204Project-0.0.1-SNAPSHOT and the project can be accessed by opening this URL under the servlet container.
However, the application can basically be deployed by using just two files from the generated WAR file. To illustrate this, we can create a new Dynamic Web Project in eclipse. Copy the html and css files from your GWET projects webapp folder into the „WebContent“ folder of this application.
You can export (select export as WAR file) this dynamic web file and upload it to the same tomcat server.
Under the URL of your newly deployed project you are able to access your GWT application.
We can download this html file to our local desktop. We will find that the application does nothing when we open the locally downloaded HTML file. This is because GWT disables cross site access for your applications by default. You can enable cross site access by adding the following line to your module descriptor (.gwt.xml).
<add-linker name=“xs” />
Recompile the GWT application and deploy it to tomcat again.
Now open the html file you have downloaded and change the location of the script to the absolute location on your webserver.
Now you can open the html file on your local desktop and the application should work from this html file as well.