The other day I was asked about Google Web Toolkit (GWT) and developing JEE applications for WebSphere ApplicationServer. GWT is Google's toolkit that allows developers to create Ajax style architectures. What is unique about GWT isthat it provides a Java library for generating JavaScript. The developer writes Java classes, compiles, and executes the classfiles to create JavaScript. The JavaScript can then be packaged and rendered. They also have a set of server side classes which can act as RESTful serviceendpoints that your JavaScript generated code can connected too. There is a
ton of information on GWT, so I won't go into detail. If your looking for a book,I enjoyed Ryan Dewsbury's Google Web Toolkit Applications.
So how can one approach GWT and WebSphere Applicaiton Server?
At the end of the day, you want a WAR file or EAR file that you can import as a Web application to WebSphere Application Server. While you can certainly use Eclipse/RAD to create a Dynamic Web Project and export the WAR alone with your GWT generated JavaScript, I've found using Ant much easier and automated. (As a side note, Eclipse is a natural development environment for GWT. GWT provides a command line tool to generate the necessary project files which can be imported into Eclipse).
I used the
gwtcompile Ant task which compiles the Java GWT class files you created, executes the classes, then dumps theJavaScript output to a directory. From there, it's pretty straight forward to collect the generated output into a WAR file. I'll typically execute the build.xml directly inside Eclipse and take the WAR and publish it to WebSphere Application Server.
Kevin Haverlock