The Tiles Tag Library

This section introduces the JSP custom tags used by the Tiles framework. Table 14-1 lists the tags available to the framework. The tags are very similar to the ones provided in any template-based framework, but with more functionality.

Table 14-1. Tags within the Tiles tag library

Tag name



Add an element to the surrounding list.


Create a tile component definition.


Get the content from request scope that was put there by a put tag.


Render the value of the specified tile/component/template attribute to the current JspWriter.


Import a tile’s attribute into the specified context.


Initialize a tile definitions factory.


Insert a tiles component.


Put an attribute into a tile context.


Declare a list that will be passed as an attribute.


Use an attribute value inside a page.

The insert Tag

The insert tag is responsible for inserting content into a page. In a layout tile, the insert tag prescribes where the content will go using attribute values. In a regular, non-layout tile, the insert tag is used to retrieve a layout and allow content to be passed to the layout using put tags. Table 14-2 lists the attributes for the insert tag.

Table 14-2. Attributes for the insert tag

Attribute name



The name of an attribute in the current tile/component context. The value of this attribute is passed ...

Get Programming Jakarta Struts, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.