You are hereBlogs / meck's blog / GWT - Not just another way of creating Websites...
GWT - Not just another way of creating Websites...
Hi everybody! Today I will talk about the GWT (Google WebToolkit). I have been using it for about one year now (not all the time), and I am now at a point where I can say, that I have a basic impression on how stuff is done or at least can be done. In this article I want to summarize what beginners with the GWT will probably face and give some (hopefully) useful hints.
For those of you who never heard of the GWT, I start with a short introduction. It is a tool/framework which lets you create AJAX websites without coding any line of JavaScript. Therefore it provides a compiler which transforms the client side of your project that is executed by the browser into JavaScript. You as a programmer just have to write Java code. You are restricted on the classes you can use on the client side though.
So what is the big picture of a running GWT application? On the client is JavaScript doing most of the application logic directly without bothering the server. More complicated tasks however can/must be done on the server side which consists of nothing less than a full featured Java Application Server like Apache Tomcat. The gap between the client and server side are overcome by using the GWT built-in RPC calls.
Sounds like a complex architecture... and in my opinion that's true. There is a lot to set up and configurate to get things working. Google provides a very easy start for beginners though. If you just want to see what the GWT is like, go to the website, grab the archive for your platform, unpack it and start by executing the skripts in the examples subfolders. It will bring you up the example applications in a Tomcat instance shipped by the GWT. That's all a thing of 5 minutes I would say.
Problems start when you try to build your own application from scratch without using the Google provided scripts. For most people it is also not possible to use the shipped Tomcat as they already have their own instance already running on a webserver. Configuration can be really complex and misconfiguration can lead to wired error messages. Especially the use of RPC calls introduces a new level of complexity. To make your first GWT experience a good one, I therefore strongly recommend:
- Start a small project and put it under version control so that you always see which files are generated by the GWT.
- After playing around a little bit try to get an external Tomcat running and use Apache Ant to set up a build system.
- If your build system is generating a war file and deploying successfully, you can know start to introduce RPCs. Note that you will probably have to adapt some config files to get it working.
- meck's blog
- Login to post comments
- Login to post comments