Archive for category GWT
Snow Leopard, Java 6 and GWT
Posted by Olivier Gérardin in GWT on 2009-09-09
Running GWT’s hosted mode on the Mac requires a 32 bit JVM, which under OS X 10.5 (Leopard) forces us to use Java 5, because Java 6 only has 64 bit libraries.
Problem: OS X 10.6 (Snow Leopard) removes all versions of Java but version 6. Fortunately, Java 6 now has a 32 bit mode, but it can’t be used straightforwardly for hosted mode because GWT insists on having Java 5…
So how do we get GWT’s hosted mode to run? Alex Moffat suggests an elegant solution:
Lombardi Development Blog » Blog Archive » Snow Leopard, Java 6 and GWT.
Fred Sauer’s GWT for the Enterprise Developer
Posted by Olivier Gérardin in GWT on 2009-09-04
Freed Sauer has a very interesting presentation online: GWT for the Enterprise Developer @ JBoss World Chicago 2009 (includes GWT 2.0 insight !)
Myths and misconceptions about GWT
Posted by Olivier Gérardin in GWT on 2009-08-31
Here is, in no particular order, a list of myths and misconceptions that I’ve gathered from reading GWT-related discussions on various websites.
Myth: GWT is a JavaScript library/framework/widget set
GWT is no use for JavaScript programmers, so it doesn’t provide anything as JavaScript: no library, no framework, no widget set. It does provide a Java library, which includes a widget set and JRE emulation classes, but these are all in Java and meant to be used from Java code.
Myth: GWT is a framework
You see this one quite often, and even the wikipedia entry for GWT used to describe it as such. The T in GWT stands for Toolkit, and that’s exactly what it is: a set of tools (in the broad sense), any of which you may or may not use. The difference between a toolkit and a framework is a subtle one, and very hard to explain, but in a word you can say that a framework is about providing reusable behaviour, while a toolkit is about providing reusable functionalities. A framework calls your code, while your code calls a toolkit. GWT provides very little predefined behaviour, and the only time it calls your code is when invoking the entry point of your class, which is the bare minimum.
And of course, you can write frameworks on top of GWT.
Myth: GWT is only for Java programmers
It’s true that GWT lets you program AJAX apps in Java, but you can also see it this way: GWT lets you write AJAX apps with the best state-of-the-art IDEs, debug them, refactor them, test them, all this in a statically-typed object-oriented language (which happens to be Java).
I think this should appeal to more than only the community of Java developers. To tell the truth, I even think that GWT alone makes it worth learning Java.
Myth: GWT generates poorly performing JavaScript
You hear this one often too. Actually it’s quite the opposite: GWT will generate far more optimized code that the vast majority of JavaScript programmers can write. I’m not saying it’s not possible to write more efficient code by hand, it probably is, just like it’s possible to make an application more efficient by hand-writing assembly code, but the improvement you can expect is marginal. So bottom line is: it’s not worth it.
Myth: GWT requires a Java backend
This misconception probably comes from the fact that GWT includes a simple and efficient RPC mechanism for calling server-side methods implemented in Java, but it’s not by far the only option. GWT handles XML and JSON like a charm, and can communicate with any type of server-side implementation over HTTP.
Myth: GWT has a poor palette of UI components
This is not totally untrue, but the thing is: it’s not the point. To be fair, GWT’s builtin widgets can be described as minimalistic, but they are still sufficient to build a complete and rich user interface. However, remember that GWT is not a framework, so it doesn’t have to be complete. If you want a complete palette of rich widgets, you should turn to third-party libraries such as Ext GWT or similar.
Myth: GWT apps have long startup times
Nonsense. Code loading times are not longer than any AJAX app, probably less because the generated JavaScript is obfuscated which makes it quite compact. And if your application is slow to initialize, it’s certainly because you are doing too much during startup: think lazy initialization.
Myth: Your site has to be all-GWT or nothing
Again, nonsense. GWT was designed from the beginning with the goal that it can be integrated into any web page. To add GWT behaviour into any existing web page you just need to add very little HTML code and it’s done.
Myth: UI customization/skinning is limited
GWT relies on CSS for styling. While this has its drawbacks, like the possibility to introduce browser dependencies that GWT tries so hard to avoid otherwise, it means that it opens the whole CSS world to GWT apps. It means you can radically change the appearance of a GWT app without touching a single line of code (this is not theory, we’ve done it). It means you can let web designers to their job of styling the app using the language they know (CSS), while letting developers do their job of providing behaviour using the language they know (Java). Bottom line: GWT skinning is as limited as CSS.
Google Eclipe plugin 1.1.0 available
Posted by Olivier Gérardin in GWT on 2009-08-02
We wanted to let all of you know that the Google Plugin for Eclipse 1.1.0 is now available. Some of the notable improvements are:
-Support for Eclipse 3.5 (Galileo)
-GWT RPC interface validation with quick fixes
- App Engine DataNucleus enhancer console no longer steals focus on save
“GWT Basic” exam on javablackbelt.com
Posted by Olivier Gérardin in GWT on 2009-07-28
I have written the objectives for a GWT basic exam at javablackbelt.com. As you may know, javablackbelt is a community site where users can take tests as well as evaluate and submit questions.
So if you have 5 minutes to spare why don’t you submit a question or two for this exam?
GWT 1.7 Now Available
Posted by Olivier Gérardin in GWT on 2009-07-15
Bruce Johnson:
GWT 1.7 is a minor update that adds better support for Internet Explorer 8, Firefox 3.5, and Safari 4 (…)
Normally, a minor update such as this would have been named 1.6.5 (the previous latest version of GWT was 1.6.4), but we did add the value “ie8″ to the “user.agent” deferred binding property, which could impact projects using custom deferred binding rules that are sensitive to that property.
Thus, we went with GWT 1.7 rather than GWT 1.6.5, to indicate that you may
need to pay attention to that change.
GWT 1.7 Now Available – Google Web Toolkit Contributors | Google Groups.
GWT Overview And Feature Preview – SV Web JUG – June 16 2009
Posted by Olivier Gérardin in GWT on 2009-06-25
GWTUML – Just Enough UML for Wikis
Posted by Olivier Gérardin in GWT on 2009-06-17
If you ever wanted to embed a UML diagramming tool into a wiki, try this:
Agile Ajax » GWTUML – Just Enough UML for Wikis » Pathfinder Development.

Under the hood GWTUML uses Tatami to leverage the Dojo toolkit.
Congratulations Florian, this is really impressive!
GWT: keep thinking in Java!
Posted by Olivier Gérardin in GWT on 2009-06-08
As a reply to a post on ongwt.com asking about tips for GWT newcomers, someone answered “think in JavaScript, not in Java”. I felt I had to respond, because my experience is totally the opposite, and that’s why I would recommend GWT to anyone who wishes to write AJAX applications while continuing to think in Java (not in JavaScript).
For the record here’s my reply:
“think in JavaScript, not in Java”: I strongly disagree with that!
JavaScript plays the same role for GWT as bytecode does for plain Java: an intermediate language, generated by the compiler, and interpreted by the runtime platform.
As for HTML and CSS, it is true that it helps a lot to know them, especially when the time has come to add styling to your application. This is by design, as explained in the developer’s guide: “instead of attempting to encapsulate UI styling behind a wall of least-common-denominator APIs, GWT provides very few methods directly related to style. Rather, developers are encouraged to define styles in stylesheets that are linked to application code using style names”.
The whole point of GWT is to shield the programmer from JavaScript and let him use the Java idiomatisms and tools he is used to. I’ve been working with GWT for almost 3 years now and I have never ever felt the need to learn JavaScript. And I thank GWT for that!
JavaScript is just a means to achieve the goal, which is: to build a rich web UI. Knowing JavaScript will not help you build a good client, instead you should concentrate on writing clean and robust client code using proven techniques such as MVC, which GWT makes really easy to use (unless you’re using GXT, but that’s another story…)
GXT: tooltips on individual TreeItems
Posted by Olivier Gérardin in GWT on 2009-05-13
In the series: “how to lose time by fixing GXT stuff that should work but doesn’t“, today we address tooltips on individual TreeItems. If you ever tried to set a tooltip on a TreeItem and got frustrated because it didn’t work, you might find this post interesting:
http://extjs.net/forum/showthread.php?p=329305#post329305
As usual, a lot of time is spent working around GXT oddities, only to find new ones… For example, Component.setToolTip takes not a ToolTip, but a ToolTipConfig. Additionally, it instantiates the ToolTip. There is no way of passing an already constructed ToolTip to a Component, which means you can’t use a subclass of ToolTip. (Hint for GXT developpers: Law of Demeter)