Book Image

Google Web Toolkit GWT Java AJAX Programming

By : Prabhakar Chaganti
Book Image

Google Web Toolkit GWT Java AJAX Programming

By: Prabhakar Chaganti

Overview of this book

<p>GWT Ajax Programming shows you how to create reliable user interfaces that enhance the user experience.<br /><br />GWT is an open source Java software development framework that makes writing AJAX applications like Google Maps and Gmail easy for developers who don't speak browser quirks as a second language. Writing dynamic web applications today is a tedious and error-prone process; you spend 90% of your time working around subtle incompatibilities between web browsers and platforms, and JavaScript's lack of modularity makes sharing, testing, and reusing AJAX components difficult and fragile.<br /><br />GWT lets you avoid many of these headaches while offering your users the same dynamic, standards-compliant experience. You write your front end in the Java programming language, and the GWT compiler converts your Java classes to browser-compliant JavaScript and HTML.</p> <h3>Chapter-by-Chapter</h3> <p><span style="font-weight: bold;">Chapter 1</span> introduces GWT, the download and installation of GWT, and running its sample application.</p> <p><span style="font-weight: bold;">Chapter 2</span> deals with the creation of a new GWT application from scratch, and using the Eclipse IDE with GWT projects, creating a new AJAX Random Quotes application, and running this new application.</p> <p><span style="font-weight: bold;">Chapter 3</span> deals with an introduction to and overview of GWT asynchronous services, and creating a prime number service and geocoder service.</p> <p><span style="font-weight: bold;">Chapter 4</span> deals with using GWT to build simple interactive user interfaces. The samples included in this chapter are live search, auto fillable forms, sortable tables, dynamic lists, and a flickr-style editable lable.</p> <p><span style="font-weight: bold;">Chapter 5</span> introduces some of the more advanced features of GWT to build more complex user interfaces. The samples included in this chapter are pageable tables, editable tree nodes, a simple log spy, sticky notes, and a jigsaw puzzle.</p> <p><span style="font-weight: bold;">Chapter 6</span> includes an introduction to JavaScript Native Interface (JSNI) and using it to wrap third-party JavaScript libraries like Moo.fx and Rico. it also includes using the gwt-widgets project and its support for the Script.aculo.us effects.</p> <p><span style="font-weight: bold;">Chapter 7</span> deals with creating custom GWT widgets. The samples included in this chapter are a calendar widget and a weather widget.</p> <p><span style="font-weight: bold;">Chapter 8</span> concerns itself with creating and running unit tests for GWT services and applications.</p> <p><span style="font-weight: bold;">Chapter 9</span> sees us using Internationalization (I18N) and client-side XML support in GWT.</p> <p><span style="font-weight: bold;">Chapter 10</span> includes the deployment of GWT applications using both Ant and Eclipse.</p>
Table of Contents (16 chapters)
Google Web Toolkit
Credits
About the Author
About the Reviewers
Preface
Running the Samples

Appendix A. Running the Samples

Here are the steps required to download and run the source code for the samples that we have developed in this book:

  1. 1. Download the ZIP file that contains the source code for our samples from the website for this book (http://www.packtpub.com/support). Unzip them to your hard disk. There should be two directories—Samples and Widgets—created when you unzip the file. These two directories contain the source code for the applications that we have developed in this book.

  2. 2. Start Eclipse 3.2. Create a new class path variable named GWT_HOME. Go to Window | Preferences | Java | Build Path | Classpath Variables. Add a new variable entry named GWT_HOME and set it to the directory where you have unzipped the GWT distribution, for example: C:\gwt-windows-1.3.1. This ensures that the GWT JAR files will be available to the samples project.

  3. 3. Import the two projects into your Eclipse workspace, one at a time. You can import an existing project into Eclipse by going to File | Import | Existing projects into Workspace and then selecting the root directory for the project. The Widgets project is used for creating the two widgets that are packaged up in a JAR file and used by the Samples project. It therefore does not define an entry point. All you need to do is run/debug the Samples project.

  4. 4. You can run the Samples project from inside Eclipse. Go to Run | Run … and select Samples. This will start up the familiar GWT shell and launch the hosted browser with the Samples application.

  5. 5. You can debug the Samples project from inside eclipse. Go to Debug | Debug … and select Samples.

  6. 6. If you have Apache Ant installed, you can use the Samples.ant.xml file to build the application and create a WAR file that can be used for deployment to a servlet container such as Tomcat.

  7. 7. You can also run the Samples-compile.cmd to compile the application and Samples-shell.cmd to run the application from a console on Windows.