Documentation
Home
Live Examples (new)
Quick overview
Tutorial
Tutorial Live Examples
Download
Installation
User Guide
Javadoc

Tag Library Reference
Tiles Tags

Printer Versions
Quick Overview
Tutorial
User Guide
Overview (old)

Old Documents
Overview (old)

Tiles User Guide

Tiles User  Guide

 

Author : Cedric Dumoulin

Date : 22 juil. 2001

Rev : 22 Jul. 2001

 

1        Tiles History

Tiles framework was previously called Components framework. Components name remain in a lot of classes and jsp files.

2        Using Tiles

To use Tiles in your project, you need following library :

  • tiles.jar
  • commons-digester.jar
  • commons-beanutils.jar
  • commons-collections.jar

You also need file tiles.tld containing tags definitions.

If you use definitions factory configuration file, you can validate it with appropriate DTD file tiles-config.dtd. You also need to initialize definitions factory.

 

3        Definitions Factory initialization

If you want to use definition factory, you need to initialize it. During this process, factory is initialized and saved in appropriate jsp context.

If you also use Struts, you can use one of the provided servlets to initialize Tiles. These servlets also provide a mechanism allowing to use definition names in Struts forwards.

  • ActionComponentServlet.java (for Struts 1.0)
  • TilesActionServlet.java (for Struts 1.1 dev) (todo)

If you don?t want to use Struts, you need to initialize yourself the definition factory. Check existing servlets to know how.

If you don?t want to use definitions factory, don?t care about it.

3.1       Definition Factory Parameters

Default definition factory accept some parameters. If factory is initialized from a servlet, using the default method (DefinitionUtil.createDefinitionsFactory), parameters can be set using the web.xml file.

3.1.1    definitions-factory-class

      <param-name>definitions-factory-class</param-name>

      <param-value>java.class.name</param-value>

 

Allows to specify a factory class name. This factory must implements interface ComponentDefinitionsFactory.

If not specified, default factory is used (xmlDefinition.I18nFactorySet).

This parameter is taken into account by DefinitionUtil.createDefinitionsFactory.

 

3.1.2    definitions-debug

      <param-name> definitions-debug </param-name>

      <param-value>integer</param-value>

 

If set, specify the debug details level. 0 means no debug information is outputted.

This parameter is taken into account by DefinitionUtil.createDefinitionsFactory.

 

3.1.3    definitions-config

      <param-name> definitions-config </param-name>

      <param-value>string</param-value>

 

Specify name of file containing definitions configuration.

It is possible to put several names, coma separated. In this case, all names are used as base name.

This parameter is taken into account by xmlDefinition.I18nFactorySet.

 

3.1.4    definitions-parser-details

      <param-name> definitions-parser-details </param-name>

      <param-value>int</param-value>

 

Specify level of detail outputted by parser (digester). Default is 0, meaning no details.

This parameter is taken into account by xmlDefinition.I18nFactorySet.

 

3.1.5    definitions-parser-validate

      <param-name> definitions-parser-validate </param-name>

      <param-value>true|false</param-value>

 

Specify if we want to use a validating parser or not. Default is no.

This parameter is taken into account by xmlDefinition.I18nFactorySet.

 

4        XML Definition Factory Syntax

Please check tiles.dtd and provided example for syntax.

To do : explain syntax here.


Copyright © 2000-2002, Apache Software Foundation
and Cedric Dumoulin