Fork me on GitHub

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 Apache Tiles™.

Requests management

Apache Tiles™ is now technology-independent, that means that Apache Tiles™ 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 Apache Tiles™ class names.

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