Module XML Format

Modules are defined in XML files whose file extension is .gwt.xml. Module XML files should reside in your project's root package.

If you are using the standard project structure, your module XML can be as simple as this:

 <module>
    <inherits name="com.google.gwt.user.User"/>
    <entry-point class="com.example.cal.client.CalendarApp"/>
 </module>

Loading Modules

Module XML files are found on the Java classpath, referenced by their logical module names from host pages and by being inherited by other modules.

Modules are always referred to by their logical names. The logical name of a module is of the form pkg1.pkg2.ModuleName (although any number of packages may be present) and includes neither the actual file system path nor the file extension. For example, the logical name of a module XML file located at

~/src/com/example/cal/Calendar.gwt.xml
is
com.example.cal.Calendar

Available Elements

<inherits name="logical-module-name"/>
Inherits all the settings from the specified module as if the contents of the inherited module's XML were copied verbatim. Any number of modules can be inherited in this manner.
<entry-point class="classname"/>
Specifies an entry point class. Any number of entry-point classes can be added, including those from inherited modules.
<source path="path"/>
Adds directories to the source path by combining the package in which the module XML is found with the specified path to identify the root of a source path entry. Any Java source file appearing in this root directory or any of its subdirectories is assumed to be translatable.

If no <source> element at all is defined in a module XML file but the directory containing the module XML contains a subdirectory called client, then the client subdirectory is added to the source path as if <source path="client"> had been found in the XML. This default helps keep module XML compact for standard project layouts.

<public path="path"/>
Adds directories to the public path by combining the package in which the module XML is found with the specified path to identify the root of a public path entry. Any file appearing in this root directory or any of its subdirectories will be treated as a publicly-accessible resource.

If no <public> element at all is defined in a module XML file but the directory containing the module XML contains a subdirectory called public, then the public subdirectory is added to the public path as if <public path="public"> had been found in the XML. This default helps keep module XML compact for standard project layouts.

<servlet path="url-path" class="classname"/>
For convenient RPC testing, this element loads a servlet class mounted at the specified URL path. The URL path should be absolute and have the form of a directory (for example, /spellcheck). Your client code then specifies this URL mapping in a call to ServiceDefTarget.setServiceEntryPoint(String). Any number of serlvets may be loaded in this manner, including those from inherited modules.