Learning Google Web Toolkit
Lost VMs or Containers? Too Many Consoles? Too Slow GUI? Time to learn how to "Google" and manage your VMware and clouds in a fast and secure HTML5 App.
Using GWT for Java developers is mostlya piece of cake. You need to download and install JDK, GWT SDK, Eclipse, Google plug-in, and the recently Instantiation designer. The designer is from acquisition of Instantiation and really optional, but it’s a great tool that can make your life easier especially for prototyping. The nice thing about the designer is that the code generated is pretty human readable, thus easy to modify.
If you are using Eclipse with Google plugin, debugging GWT web application is very similar to other applications.
On the server side, you write implementation class Y that implements X and extends from “com.google.gwt.user.server.rpc.RemoteServiceServlet”. It’s pretty straight-forward.
On the client side, it’s a bit different. You need to create a corresponding asynchronous communication interface AsyncX with a bit of twisting on the interface. If you have a method as: (from Lars’ tutorial, the same for the next)
The asynchronous version looks like:
void getUserList(AsyncCallback<List<MyUser>> callback);
Then you implement the AsyncCallback<List<MyUser>> interface in a class and register it with service so that the callback can be invoked when response comes back. It is not that straight forward. You’d better off to run through a sample for a better sense how it works.
While learning the GWT, I found the tutorial by Lars Vogel very helpful. It walks you through a right sized sample step-by-step within 2 hours. You can find many different tutorials from his web site. I highly recommend Lars’ tutorials.