This project has retired. For details please refer to its Attic page.
Apache Tiles - Framework - Tiles Extension Points

Tiles Extension Points

Tiles can be extended in different aspects, depending on the task of each aspect.

Tiles Container

The Tiles container is the object responsible of loading and rendering all Tiles artifacts. It is not created directly, but through a TilesContainerFactory. The default implementation is BasicTilesContainer.

It is unlikely that you need to customize your Tiles container (and container factory) and we suggest to use the default container factory.

As an exception, you can use KeyedDefinitionsFactoryTilesContainerFactory that allows to create multiple definitions factory for different "keys".

Tiles Context Factory

The TilesRequestContext and TilesApplicationContext interfaces are used to abstract the Tiles context from the particular technology. The TilesContextFactory interface is used to create instances of the 2 classes above.

The default implementation, ChainedTilesContextFactory links together different implementation. The default configuration links together the implementation for Servlet, Portlet and JSP technologies. If you need to support a new technology, we suggest to configure ChainedTilesContextFactory and create a new instance of TilesContextFactory.

Tiles Definitions Factory

The DefinitionsFactory interfaces is used to create and retrieve definitions. The returned definition will be used to be rendered by the Tiles container.

The default implementation, UrlDefinitionsFactory can be configured, or can be used as a basis for an extended factory.

You can provide your implementation of UrlDefinitionsFactory if you need to return definitions in a non standard way (for example, getting a definition depending on a value of a bean in request scope).

Preparer Factory

The PreparerFactory is responsible of creating instances of ViewPreparer.

The default implementation, BasicPreparerFactory takes the preparer name as a class name, instantiates an object per each class name and returns it.

You can change this behaviour by implementing PreparerFactory. For example, the Struts 1 plugin contains an implementation that takes an URL or an action mapping as a preparer name, and creates an instance accordingly.