SiteMesh is bundled with 2 tag-libraries.

For installation instructions, see Installation and Configuration, and for usage instructions and examples see Building Decorators.

Note that the tags below are listed without the namespace prefixes as these are defined by the user when importing the tag library into the JSP page.

Decorator Tags Page Tags
Used to create decorator pages. Used to access decorators from content pages.
<decorator:head />
<decorator:body />
<decorator:title />
<decorator:getProperty />
<decorator:usePage />
<page:applyDecorator />
<page:param />

Decorator Tags

These tags are used to create page Decorators. A Decorator is typically built up from an HTML layout (or whatever is appropriate for the original page content-type) with these tags inserted to provide place-holders for the data from the original (undecorated) page.

For more details, see Building Decorators.

<decorator:head />

Description:

Insert contents of original page's HTML <head> tag. The enclosing tag will not be be written, but its contents will.

Attributes:

<decorator:body />

Description:

Insert contents of original page's HTML <body> tag. The enclosing tag will not be be written, but its contents will.

Note: the content of the body onload and onunload events (and other body attributes) can be included in the decorator by getting the property body.onload and body.onunload (the named attributes).
For example (the decorator): <body onload="<decorator:getProperty property="body.onload" />">

For more information: see getProperty.

Attributes:

<decorator:title [ default="..." ] />

Description:

Insert title of original page (obtained from <title> tag). will be used instead.

Attributes:

<decorator:getProperty property="..." [ default="..." ] [ writeEntireProperty="..." ]/>

Description:

Insert property of original page. See API reference for HTMLPage for details of how properties are obtained from a page.

Attributes:

<decorator:usePage id="..." />

Description:

Expose the Page object as a variable to the decorator JSP.

Attributes:

Example:

<decorator:usePage id="myPage" />
<% if ( myPage.getIntProperty("rating") == 10 ) { %>
  <b>10 out of 10!</b>
<% } %>

Page Tags

The page tags, are used to apply decorators to inline or external content from within the current page.

<page:applyDecorator name="..." [ page="..." title="..." ] >
   .....
</page:applyDecorator>

Description:

Apply a Decorator to specified content. The content can either be inline by specifying a body to the tag, or by using the result of another page by specifying the page attribute.

Attributes:

Body:

The content to have the Decorator applied to.

<page:param name="..."> ... </page:param>

Description:

Pass a parameter to a Decorator. This will override the value called from Page.getProperty() or <decorator:getProperty/>. This tag is only valid inside a <page:applyDecorator> tag.

Attributes:

Body:

The value of the parameter.