The other day I was asked about Google Web Toolkit (GWT) and developing JEE applications for WebSphere Application
Server. GWT is Google's toolkit that allows developers to create Ajax style architectures. What is unique about GWT is
that it provides a Java library for generating JavaScript. The developer writes Java classes, compiles, and executes the class
files 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 service
endpoints 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 the
JavaScript 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.
About Kevin Haverlock Kevin Haverlock is an advisory software engineer for IBM's WebSphere Application Server product. He joined IBM in 1995 at Research Triangle Park, NC, where he worked as a developer for the Tivoli division. In 2000 he transferred to the WebSphere Application Server organization and is currently an architect and developer for the WebSphere Application Server Express product.
Subscribe to the World's Most Powerful Newsletters
Subscribe to Our Rss Feeds & Get Your SYS-CON News Live!
Click to Add our RSS Feeds to the Service of Your Choice: