Having discussed the starter GWT web project, we will create a new GWT web application. Select File | New | Other in Eclipse. In New, select Google | Web Application Project and click on Next, as shown in the following screenshot:
The New Web Application Project wizard gets started. Specify Project name (gwt-jboss-ajax
) and Package (org.jboss.gwt
). Select the default setting for Location. In Google SDKs, click on the Use Google Web Toolkit checkbox and click on Configure SDKs, as shown in the following screenshot:
A filtered version of Preferences gets listed with only Google | Web Toolkit. Click on Add to add a new SDK, as shown in the following screenshot:
In Add Google Web Toolkit SDK, select Installation directory for GWT 2.6 (C:gwt-2.6
) with Display name as gwt-2.6.0
, as shown in the following screenshot. Then, click on OK.
A GWT SDK gets added to Preferences, as shown in the following screenshot:
In the New Web Application Project wizard, click on the Create a Web Application Project window. Click on Finish.
A Google Web Application project, which is essentially a GWT project, gets created with the directory structure shown in the following screenshot:
A typical GWT web project consists of the following files, modules, and pages:
We will create a GWT web application to create a catalog entry with an input form. The input widgets for the input form will be specified in a client Java source file. A GWT module will specify the configuration. An HTML host page will run the module in a browser. As GWT widgets support Ajax, we will validate a new catalog entry dynamically with Ajax. Before we create a new GWT project, delete the files created in the default Google Web Application project, except the gwt-jboss-ajax
project root folder, the subdirectories in the src
folder, and the war
directory, including the web.xml
deployment descriptor in the //gwt-jboss-ajax/war/WEB-INF
folder. Add a pom.xml
file (select XML | XML File in the New wizard) for a Maven project to the root folder /gwt-jboss-ajax
. The directory structure of the gwt-jboss-ajax
project is shown in the following screenshot: