As of SiteMesh 2.X? Tapestry (.html) decorators are supported.

Here is an example of how such a decorator (e.g. /WEB-INF/Decorator.html) might look like:

<html jwcid="shell">
  <body jwcid="@Body">
    <div id="pageTitle"><span jwcid="@sitemesh:Title"/></div>
    <hr/>
      
    <span jwcid="@sitemesh:Body"/>
  </body>
</html>

With the corresponding Tapestry page specification (e.g. /WEB-INF/Decorator.page):

<?xml version="1.0"?>
<!DOCTYPE page-specification PUBLIC
  "-//Apache Software Foundation//Tapestry Specification 3.0//EN"
  "http://jakarta.apache.org/tapestry/dtd/Tapestry_3_0.dtd">

<page-specification>
  <component id="shell" type="Shell">
    <binding name="title">
     'Tapestry Decorator - ' + @com.opensymphony.module.sitemesh.tapestry.Util@getTitle(requestCycle)
    </binding>
    <binding name="stylesheet" expression="assets.stylesheet"/>
    <binding name="delegate">
     @com.opensymphony.module.sitemesh.tapestry.Util@getHeadRenderer(requestCycle)
    </binding>
  </component>
  
  <context-asset name="stylesheet" path="/main.css"/>
</page-specification>

Installation

A working example is included with the SiteMesh distribution, under the src/example-webapp directory.

Components

These components are used to create page Decorators. A Tapestry page decorator is an HTML layout with these components inserted to provide place-holders for the data from the original (undecorated) page.

Head

Description:

Insert contents of original page's HTML <head> tag. The enclosing tag will not be be written, but its contents will. Note: if you are using Tapestry's built-in Shell component, use the com.opensymphony.module.sitemesh.tapestry.Util.getHeadRenderer(cycle) method with the Shell's 'delegate' parameter instead.

Parameters:

Example:

<span jwcid="@sitemesh:Head />

Body

Description:

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

Note: To include body onload and onunload events (and other body attributes) by using Tapestry's Script component and the com.opensymphony.module.sitemesh.tapestry.Util.getProperty(name, cycle) method.
See the SiteMesh example web application Tapestry.html/Tapesty.page/Tapestry.script combination to see how onload can be included in the decorator.

Parameters:

Example:

<span jwcid="@sitemesh:Body" />

Title

Description:

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

Parameters:

Example:

<span jwcid="@sitemesh:Title" default="Default title" />

Property

Description:

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

Parameters:

Example:

<span jwcid="@sitemesh:Property" property="meta.author" default="anonymous"/>

Utility API

The com.opensymphony.module.sitemesh.Util class includes a few methods to make getting pieces of the decorated page accessible to OGNL expressions and Java code.

static public String getTitle(IRequestCycle cycle)

Returns contents of original page's HTML <title> tag. The enclosing tag will not be be included, but its contents will.

static public String getProperty(String name, IRequestCycle cycle)

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

static public IRender getHeadRenderer(IRequestCycle cycle)

Returns an IRender suitable for use with Tapestry's Shell components 'delegate' parameter. See the SiteMesh example application for an example usage.