Deploying GWT applications

Once you have built your Google Web Toolkit application run the -compile.cmd script, or hit the compile/browse button in the debugger. It will open in a browser window and you will be able to double check that it works properly as javascript. At this point you should also double check that it looks fine in multiple browsers such as IE/FireFox/Opera.

The compiled files will be written to the www/com.your.app in the GWT directory. Open this directory and you will notice several .cache.html and .cache.xml files, as well as the gwt.js file. There will also be several image files. You will need need all of these except tree_closed.gif, tree_open.gif, and tree_white.gif if you did not use a tree in your application.

After compiling out your Google Web Toolkit Ajax application everything is in the same www directory and works great. But what if you want to move all the GWT files to a different directory then the page you are calling it from? To do this you need to update 2 to 3 parts of your page that calls in the app.

First change to include the directory and an equals sign. For example, if I put my GWT app in a directory called webapps I would have the following:

Second change path of the gwt.js file to include the new directory as you normally would for a javascript file.

Third if you included the history.html file change the path on the iframe also to include the directory. If you do not wish to include history support you may leave the iframe out all together.

2 Responses to “Deploying GWT applications”

  1. Matt Brozowski says:

    Any chance you can add the code snippets that you reference for this post?

    Thanks!
    Matt Brozowski

  2. Jeremy says:

    View the source and you’ll some a meta tags with “content” attributes. Those would be the code snippets.

Leave a Reply