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
- An entry point application class name; these are optional, although
any module referred to in HTML must have at least one entry-point class
specified
- Source path entries
- Public path entries
- Deferred binding rules, including property providers and class
generators
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 subpackages contain translatable
source,
causing the named package and its subpackages 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 subpackages are
public, causing the
named package and its subpackages 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
-
-
Modules can contain references to external JavaScript and CSS
files, causing them to be automatically loaded when the
module itself is loaded.
-
Filter files into and out of your public path to avoid
publishing files unintentionally.