Tutorials: Overview
These tutorials are intended for developers who wish to write rich AJAX applications using GWT. You might be a Java developer who would like to be able to apply the software engineering principles of object-oriented programming and leverage the tools in your Java IDE when writing applications for the web. Or you might be a JavaScript guru curious about GWT’s ability to generate highly optimized JavaScript.
Although a knowledge of HTML, CSS, and Java is assumed, it is not required to run these tutorials.
These tutorials are based on the development of two example applications, such that the user learns different GWT concepts in each step.
- StockWatcher is an application for monitoring stock variations, and you can get the sources from github
- TodoList a web application to create and maintain a Todo checklist in browser. Sources are available at github as well.
Before You Begin
Before you begin these tutorials, we assume that you’ve done the following:
- Installed the Java SDK.
- If you don’t have a recent version of the Java SDK installed, download and install Java Standard Edition SDK.
- Installed Eclipse or your favorite Java IDE.
- In these tutorials, we use Eclipse because it is open source. However, GWT does not tie you to Eclipse. You can use IntelliJ, NetBeans or any Java IDE you prefer. If you use a Java IDE other than Eclipse, the screenshots and some of the specific instructions in the tutorial will be different, but the basic GWT concepts will be the same.
- If your Java IDE does not include Apache Ant support, you can download and unzip Ant to easily compile and run GWT applications.
- Installed the Google Plugin for Eclipse.
- The Google Plugin for Eclipse adds functionality to Eclipse for creating and developing GWT applications.
- Downloaded GWT.
- GWT can be downloaded with the Google Plugin for Eclipse. Alternatively, download the most recent distribution of GWT for your operating system.
- Unzipped the GWT distribution in directory you want to run it in.
- GWT does not have an installation program. All the files you need to run and use GWT are located in the extracted directory.
You may also optionally do the following:
Install the Google App Engine SDK.
- Google App Engine allows you to run Java web applications, including GWT applications, on Google’s infrastructure. The App Engine SDK can be downloaded with the Google Plugin for Eclipse. Alternatively, download the App Engine SDK for Java separately.
Create and run your first web application - A few, simple steps to familiarize you with the command line commands.
GWT Tutorials
Build a Sample GWT Application
- Get started with GWT by developing the StockWatcher application from scratch. You’ll learn to create a GWT project, build the UI with GWT wigdets and panels, code the client-side functionality in the Java language, debug in development mode, apply CSS styles, compile the Java into JavaScript, and run the application in production mode.
Client-Server Communication
- Communicating with the server via GWT RPC
- Add a call to a server using GWT RPC. You’ll learn how to make asynchronous calls, serialize Java objects, and handle exceptions.
- Retrieving JSON data via HTTP
- Make HTTP requests to retrieve JSON data from a server. The same technique can be used to retrieve XML data.
- Making cross-site requests
- Make a call to a remote server, working around SOP (Same Origin Policy) constraints.
Internationalization
- Internationalizing a GWT application
- Translate the user interface of a GWT application into another language using Static String Internationalization.
JUnit Testing
- Unit testing with JUnit
- Add unit tests to a GWT application using JUnit.
Deploying to Google App Engine
- Deploying to Google App Engine
- Deploy a GWT application to App Engine.
Building Modern Apps with GWT & Polymer
Write responsive GWT applications for mobile and desktop using Polymer Elements and JsInterop.
- Create a GWT app.
- Get started with GWT creating new maven projects from scratch, running and debugging them in SuperDevMode, and including external dependencies.
- Design the UI
- Code the application logic