GWT and XML – First steps with com.google.gwt.xml
Developing web applications and portals using eclipse, GWT (google web toolkit) and apache tomcat is one of the most effective ways to get your work done: The result will always be a very high-performance AJAX application. To exchange data from the AJAX surface to the tomcat-server, I decided to use the GWT RPC, exchanging XML data structures.
Therefor GWT provides a nice package: com.google.gwt.xml.client.*
com.google.gwt.xml.client.* is a complete toolkit to deal with xml data-structures on the JavaScript clientside in a high perfomant way.
After having importing the needed packages as usual, I wrote some code to create a new XMLDom stucture. But when running the new code, the following error occured:
Line 52: No source code is available for type com.google.gwt.xml.client.Document; did you forget to inherit a required module?
Up to this point I was used to the fact, that eclipse did everything for me; so I had absolutly no idea what to do, since google returned no hints to this problem. I started to study the documentation and the project in detail and found the solution:
To “inherit” the XML module in GWT, you have to add the following line to the gwt.xml:
<inherits name="com.google.gwt.xml.XML" />
The gwt.xml file can be found under your project in the path: <project>/src/<your domain>/<project>.gwt.xml
After adding this line, dealing with XMLs is really simple. I’ll post an article here with examples, as soon as I can get a little time for my blog again.