Modules
Individual units of GWT configuration are XML files called
modules.
A module bundles together all the configuration settings that your GWT
project needs, namely
- Inherited modules (zero or more)
- An entry point application class name (optional, although any module
referred to in HTML must have an app class specified)
- Published entry points into back-end services (zero or more)
- Names of packages containing publicly-accessible static resources,
referred to as public packages (zero or more)
- Deferred binding rules, including property providers and class
generators (zero or more)
Modules may appear in any package in your classpath, although it is
strongly recommended that they appear in the root package of a
standard project layout.
Entry-Point Classes
A module entry-point is any class that is assignable to
EntryPoint and that can be constructed
without parameters. When a module is loaded, every entry point class is
instantiated and its
EntryPoint.onModuleLoad() method gets
called.
Source Path
Modules can specify which subdirectories contain translatable
source,
causing the named directory and its subdirectories to be added to the
source path. Only files found on the source path are candidates
to be translated into JavaScript, making it possible to mix
client-side and
server-side code
together in the same classpath without conflict.
When module inherit other modules, their source paths are combined so
that each module will have access to the translatable source it requires.
Public Path
Modules can specify which subdirectories are
public, causing the
named directory and its subdirectories to be added to the
public path.
When you compile your application into JavaScript, all the files that can
be found on your public path are copied to the module's output directory.
The net effect is that user-visible URLs need not include a full package
name.
When module inherit other modules, their public paths are combined so
that each module will have access to the static resources it expects.
Specifics