Home > Contents > Index >
Looks up a map value for a given Template or CSElement.
<render:lookup key="name of lookup key" varname="output variable name" [site="site name"] [tid="id of template or cselement"] [ttype="CSElement|Template"] [match="x|x:|:x"] />
key
(required)varname
(required) site
(optional)site
variable.tid
(optional)ttype
must be set to CSElement
.ttype
(optional)CSElement
or Template
, depending on whether you are trying to look up the mapping for a Template or a CSElement. The default value is Template
match
(optional)asset type : asset name
and match is set to :x
then the asset name will be returned. The table below describes the map forms. Map entry type | Map form |
---|---|
asset name | asset type : asset name |
asset id | asset type : asset id |
asset type | asset type |
template name | template name |
This tag looks up a map value and returns it, filtered based on the match attribute's pattern.
Templates and CSElements contain execution logic, such as JSP or XML code. If asset names, ids, or even types are hard-coded in the Template or CSElement logic, then if the referenced asset is replicated, the template may no longer refer to the replicated asset correctly (the asset id may change). For this reason, Templates and CSElements support mapped variables. Mapped variables contain a key
and a value
, and are "attached" to a template instance and a site. In a mapped variable, the actual asset information (name, type, id, etc.) is recorded as a map value, and it is assigned an arbitrary key by the template developer. The key is then used in the template logic to look up the value, so that the value is always retrieved dynamically.
Map data is therefore as important to a template as the code itself.
This tag allows map values to be retrieved for the specified template.
The possible values of errno
include:
Value |
Description |
---|---|
-10004 |
A required parameter is missing. |
Assume a template name is FSIILayout, and the site containing this template has a site prefix of FSII. If that site is replicated, then the FSIILayout template name will be copied, and the copy will have a template name of NewLayout (assuming the new site's prefix is New). Referring to this template by name would result in a failure when the template is executed. Instead, the template name is looked up:
<%-- Look up the name of the layout template --%> <render:lookup varname="LayoutVar" key="Layout" <%-- Look up the name of the wrapper page's site entry. Note we want the asset name only, so we must specify the match filter. --%> <render:lookup varname="WrapperVar" key="Wrapper" match=":x"/>
Home > | Contents > | Index > | ||
![]() |
Oracle JSP Tag Reference |