Monday, July 20, 2009

Google Web Toolkit Getting Started

Last week one of my friend asked me if I can join him to write a book about Java. He told me that it's very difficult to find books about Java in stores. I agree with that. Nowadays Microsofts technologies seem more popular than any other open source technologies. He gave ideas about writing web-based application book.

Because AJAX is very popular at present, we decided to write Google Web Toolkit, one of the most popular open source AJAX-based technology to build rich internet application. But the problem is I don't know anything about GWT. But I think it's not difficult to be learnt.

I started with downloading ebooks about GWT and it's latest toolkit. But then a link pointing me to google documentation about google plugins for eclipse. Interesting... now I love eclipse very much, we can do almost everything with eclipse.

In order to use this plugin, we need eclipse 3.4 Ganymede. You can go to this link for detail instructions : http://code.google.com/eclipse/docs/install-eclipse-3.4.html.

If you downloaded the toolkit (I downloaded gwt-linux-1.7.0) from http://code.google.com/webtoolkit/download.html you'll find a folder called samples which is collection of samples provided for you. You can use these samples and import it in eclipse. First go to one of the samples you want to import and run ant there : matt@digitalfortress:~/Desktop/gwt-linux-1.7.0/samples/DynaTable$ ant eclipse.generate. After successfully running this command you can use popular eclipse 'imports existing project into workspace' menu to import it and run as usual.

How to run the application? There are two modes how you can run your application. The first is hosted mode, and the second is web mode. To run in hosted mode just click the popular 'run' green button in eclipse. To run in web mode from hosted mode click 'compile/browse' button from GWT hosted mode browser.

But before running on web mode add this : export GWT_EXTERNAL_BROWSER=/usr/bin/firefox to your environment variable (/etc/profile) to set your default web browser so that GWT knows which browser to be fired up when you want to run on web mode.

0 comments:

 

©2009 Stay the Same | by TNB