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:
- None
<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 propertybody.onload
andbody.onunload
(the named attributes).
For example (the decorator):<body onload="<decorator:getProperty property="body.onload" />">
For more information: see getProperty.
Attributes:
- None
<decorator:title [ default="..." ] />
Description:
Insert title of original page (obtained from
<title>
tag). will be used instead.
Attributes:
-
default (optional)
Value to be inserted if title not found.
<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:
-
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 aretrue
,yes
and1
.
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 id="..." />
Description:
Expose the Page object as a variable to the decorator JSP.
Attributes:
-
id (required)
Name of variable to assign to.
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 thepage
attribute.
Attributes:
-
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 asPage.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 name="..."> ... </page:param>
Description:
Pass a parameter to a Decorator. This will override the value called fromPage.getProperty()
or<decorator:getProperty/>
. This tag is only valid inside a<page:applyDecorator>
tag.
Attributes:
-
name (required)
The name of the parameter to override.
Body:
The value of the parameter.