Google Web Toolkit Features
- User Interface
GWT provides the users with a rich content to develop UI, widgets are the basic components provided which includes buttons, text boxes, etc. In addition to this we have Panels, Tabs, HTMl elements.
- Remote Procedure Calls
GWT is built in such a way that all the classes are serializable and the framework is structured to support RPCs with Servers.
- Ultra debugging:
As the code is compiled by JVM before the run time, it ease the work of debugging and error fixing. High end IDEs like Eclipse can assist in this.
- Browser compatible:
Your GWT applications automatically support IE, Firefox, Mozilla, Safari, and Opera with no browser detection or special-casing within your code in most cases.
- Internationalization:
The set of APIs available for Internationalization is very well synchronized with the user class structure which makes the implementation easier.
- Interoperability
We can add our own JavaScript in the Java source code using our JavaScript Native Interface (JSNI), which gives a broad area for implementing the business.
Deploying GWT Applications
- Hosted mode – In hosted mode, the application is run as Java bytecode in the Java Virtual Machine (JVM). The code is mere java code, and all the debugging and exception handling are same. This ease the development process when compared to other frameworks, where javascript compilation is a big headache.
- Web mode – In this mode, the application is run as Javascript and HTML, there will be one boot strap js called gwt.js, which kick starts the thread.
Time for Action—Downloading GWT
In order to use the GWT, you will need to have Java SDK installed. If you do not already have the Java SDK, you can download the latest version from http://java.sun.com/javase/downloads/. Install the SDK using the instructions provided by the download for your platform.
Now, you are ready to download GWT:
- GWT is available for Windows XP/2000, Linux, and Mac OS X platforms from the GWT download page (http://code.google.com/webtoolkit/download.html). This download includes the GWT compiler, hosted web browser, GWT class libraries, and several sample applications.
- Unzip the downloaded GWT distribution to your hard disk. It will create a directory named gwt-windows-xxx on Windows and gwt-linux-xxx on Linux, where xxx is the version number of the downloaded distribution. We will refer to the directory that contains the unzipped distribution as GWT_HOME. The GWT_HOME directory contains a samples folder with seven applications.
- In order to ensure that the GWT is correctly installed, run the Hello sample application for your platform by executing the startup script for your platform (the executable scripts for Windows have the extension .cmd and the ones for Linux have the extension .sh).
Execute the Hello-shell script for your platform.Click on the Click me button and you will get a dialog box as follows :
Action behind
The GWT_HOME directory contains all the scripts, files, and libraries needed for GWT development, which are as follows:
doc : This directory contains the API documentation for the various GWT classes.The API documentation is provided in two formats—the Google custom format and the familiar javadoc format.samples : A directory that contains the sample applications.
gwt-*.jar : These are the Java libraries that contain the GWT classes.
index.html: This file is used as Readme for the GWT.
It also provides a starting point for the GWT documentation along with pointers to other sources of information.
gwt-ll.dll and swt-win32-3235.dll: These are Windows’ shared libraries (Windows only).
libgwt-11.so, libswt-gtk-3235.so, libswt-mozilla17-profile-gcc3-gtk-3235.so, libswt-mozilla17-profile-gtk-3235.so, libswt-mozilla-gcc3-gtk-3235.so, libswt-mozilla-gtk-3235.so, and libswt-pi-gtk-3235.so: These are Linux shared libraries (Linux only).
applicationCreator: This is a Script file for creating a new application.
junitCreator: This is a Script file for creating a new JUnit test.
projectCreator: This is a Script file for creating a new project.
i18nCreator: This is a Script file for creating internationalization scripts.
When you executed Hello-shell.cmd, you started up the GWT development shell and provided the Hello.html file as a parameter to it. The development shell then launched a special hosted web browser and displayed the Hello.html file in it. The hosted web browser is an embedded SWT web browser that has hooks into the Java Virtual Machine (JVM). This makes it possible to debug the Java code for the application, using a Java development environment such as Eclipse
Sample GWT applications
There are so many sample applications given by google which will give a brief outlook of the GWT structure and methodology. This can be found at http://code.google.com/webtoolkit/documentation/examples/
For more on Getting Started, refer to
http://code.google.com/webtoolkit/gettingstarted.html
Conclusion
GWT is highly user friendly, easy to use development Framework which makes developer’s life easy and it is a best solution for AJAX Development. The GWT provides a Java-based development environment that enables you to build AJAX applications using the Java language. It encapsulates the XMLHttpRequest object API, and minimizes the cross-browser issues. So, you can quickly and efficiently build AJAX applications without worrying too much about tailoring your code to work in various browsers. It allows you to leverage the Standard Widget Toolkit (SWT) or Swing style programming by providing a framework that enables you to combine widgets into user interfaces. This is a great way to improve productivity and shorten your development time lines, by leveraging your knowledge of the Java programming language and your familiarity with the event-based interface development framework.