Introduction

Tiles extensions is the part of Tiles where a major effort in refactoring is needed.

The internal part of Tiles changed completely, not only in classes names, but also in their behaviour.

Writing definitions factories

Usually, Struts-Tiles extension writing meant writing a DefinitionsFactory or a FactorySet implementation. Here you will find how to convert your definitions factory to work correctly with Tiles 2.

Requests management

Tiles 2 is now technology-independent, that means that Tiles 2 is no longer bound to a Servlet environment. That means for you that all references to HttpServletRequest and HttpServletResponse have been removed, replacing them with TilesRequestContext

Definitions factory implementation

The most common way to implement a Definitions Factory is extending the UrlDefinitionsFactory class, that contains code to load definitions, resolve Locale-specific definitions, etc.

If you implemented FactorySet, here comes the bad news: it has been removed! Getting a "key" to map different definitions factory was an uncommon implementation detail. But it is easily reproducable, since you can take the TilesRequestContext and calculate your "key". This key can be used to map different Definitions instances, or to be given to an instance of a class extending Definitions. Whatever you choose, it's only a question of taste.

Class and interfaces new names

The following is a conversion table between Struts-Tiles and Tiles 2 class names.

Struts-Tiles Tiles 2
ComponentDefinition Definition
XmlDefinitionsSet Definitions
XmlAttribute Attribute
ComponentListAttribute ListAttribute
I18nFactorySet UrlDefinitionsFactory
XmlParser DigesterDefinitionsReader