Tiles Overview

 < Day Day Up > 



Before getting into the details of using the Tiles framework, it’s necessary to give an overview of how Tiles works. Tiles allows you to exploit the concept of JSP includes by providing a framework for defining and dynamically populating page layouts. Each page layout is simply a JSP that defines a template frame (or outline) with placeholders for where content should go. At run time, Tiles replaces the placeholders with their associated content, creating a complete page and unique instance of the layout. To accomplish this, Tiles uses its concepts of definitions and attributes.

A Tiles definition creates a piece of content that Tiles can insert into a JSP using that definition’s name. Each definition consists of a name (or identifier), a layout JSP, and a set of attributes associated with the definition. Once defined, a definition can be included in a page or, as is most often the case, be used as the target of a Struts forward. In both cases, when the definition is encountered, Tiles passes to the layout JSP specified by the definition the set of attributes that were declared for that definition. An attribute value can be the path to a JSP, a literal string, or a list of either.

To facilitate the use of definitions and attributes, Tiles uses an XML configuration file (tiles-defs.xml) for storing their definitions. Tiles also provides a JSP tag library for defining definitions and attributes. Additionally, the Tiles Tag Library is used for inserting attributes into JSPs.



 < Day Day Up > 



Struts. The Complete Reference
Struts: The Complete Reference, 2nd Edition
ISBN: 0072263865
EAN: 2147483647
Year: 2003
Pages: 134
Authors: James Holmes

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net