dsp:tomap provides access to Dynamic Bean components, standard JavaBean components, page parameters, and values by other tags that use EL or scripting variables. When you pass a parameter, component, or other value to a dsp:tomap tag, the object that is referenced by the EL or scripting variable treats the input as a Map. For example, when you pass in a component, the component appears as a Map in which the properties are keys and the property values are values.

You must use dsp:tomap in order to access a repository item in an EL expression.

Attributes

TagVariable:varorid(Required)

You must define an EL variable or scripting variable:

Attribute

Description

var

Names an EL variable. When you use var , you can set the scope attribute to page, request, session, and application, to specify the variable’s accessibility to other resources.

id

Names a scripting variable, which scriptlets and expressions can access at runtime.

VariableScope:scope

The scope attribute determines what resources can access the named EL variable. Options include: page, request, session, or application. Omitting this attribute causes the default, page, to be used.

SourceValue:bean,param,orvalue(Required)

Set the variable to a RepositoryItem bean, page parameter, or constant value that can be retrieved be other tags.

Attribute

Description

bean

Bean or bean and property that is processed by dsp:tomap and available to other tags through the object referenced by the EL variable. Should include Nucleus path, component, and property name (when applicable).

param

Page parameter that is processed by dsp:tomap and available to other tags through the object referenced by the EL variable.

value

Value that is processed by dsp:tomap and available to other tags through the object referenced by the EL variable.

Example

<dsp:tomap var="currentProfile" bean="Profile"/>
<dsp:tomap var="address" bean="Profile.homeAddress"/>
  Hello <c:out value="${currentProfile.firstName}"/>
  Do you still live in <c:out value="${address.city}"/>

In this example, the Profile component is saved to the object referenced by currentProfile so Profile.firstName and Profile.homeAddress.city other tags can use EL to render them.

 
loading table of contents...