Skip to end of metadata
Go to start of metadata

SiteMesh is bundled with 2 tag-libraries.

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 DecoratorMappers.

Decorator Head

Description

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

Decorator Body

Description

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

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.

Decorator Title

Insert title of page being decorated. The value is obtained from <title> tag.

Attributes

Attribute

Description

default (optional)

Value to be inserted if title not found.

Decorator getProperty

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

 Attributes

Attribute

Description

property (required)

Name (key) of property to insert.

default (optional)

Value to be inserted if property not found.

writeEntireProperty (optional)

This writes the property with a space in front including the name ( propertyName="propertyValue")
Accepted values are true, yes and 1.

For example:

The decorator: <body bgcolor="White"<decorator:getProperty property="body.onload" writeEntireProperty="true" />>

The undecorated page: <body onload="document.someform.somefield.focus();">

The decorated page: <body bgcolor="White" onload="document.someform.somefield.focus();">

Decorator usePage

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

Attributes

Attribute

Description

id (required)

Name of variable to assign to.

Example

Page Tags

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

Page applyDecorator

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

Attribute

Description

name (required)

Name of the Decorator to apply to the included page.

page (optional)

Points to the external resource which should expose an entire page (e.g. another JSP file producing a valid page).
This attribute can be relative to the page it is being called from, or an absolute path from the context-root.

title (optional)

Override the title of the page available as Page.getTitle() or <decorator:title/> from within the Decorator.
This is identical to specifying <page:param name="title">...<page:param>.

Body

The content to have the Decorator applied to.

Page Param

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

Attribute

Description

name (required)

The name of the parameter to override.

Body 

The value of the parameter.

Icon

This page is up for review

  • No labels