Previous Section
Table of Contents
Next Section


Chapter 17: The Tiles Configuration File

Overview

The Tiles framework, which supports the creation of regions within a page, provides a rich JSP templating system that extends beyond JSP’s built-in include mechanism. Like the include mechanism, Tiles templates can be defined and accessed via JSP Tag Library tags. However, Tiles takes it one step further by allowing your application’s configuration to be specified declaratively in an external configuration file instead of being hard-coded into JSPs. This greatly simplifies development because many changes can be made to the application without having to recompile any code.

The Tiles configuration file is XML-based and its format is governed by a Document Type Definition (DTD) file that specifies how the configuration tags must be ordered in the file, what settings are required, and so on. Each Tiles configuration file declares its conformance to the DTD by having the following DOCTYPE definition at the top of the file:

<!DOCTYPE tiles-definitions PUBLIC
  "-//Apache Software Foundation//DTD Tiles Configuration 1.1//EN"
  "http://jakarta.apache.org/struts/dtds/tiles-config_1_1.dtd">

When Tiles reads the configuration file, its XML parser uses the DOCTYPE definition to determine to which DTD the XML file must conform. If configured to do so, the XML parser will validate the XML file’s conformance to the DTD.

Note 

An in-depth discussion of the Tiles framework is found in Chapter 7.



Previous Section
Table of Contents
Next Section