dsp:getvalueof creates an EL variable that references the specified component property or page parameter. Tags nested within dsp:getvalueof can access this variable.

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. The idtype attribute corresponds with the id attribute.

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:beanorparam(Required)

Provide a bean property or a page parameter to be referenced by the named EL variable.

Attribute

Description

bean

Property with the value to be referenced by the EL variable. Should include Nucleus path, component, and property name.

param

Page parameter with the value to be referenced by the EL variable.

DataType:idtypeorvartype

If you want the returned item to be a value that is a data type other than java.lang.Object, set that type to the vartype attribute. For example, if you set the EL variable to a page parameter that holds a string, set the vartype to java.lang.String so the returned value can execute string-specific methods without explicit typecasting in the future. The returned value must be assignable to the idtype you specify.

Attribute

Description

vartype

Specifies a data type for the object referenced by the EL variable.

idtype

Specifies a data type for the object referenced by the scripting variable.

Example

<dsp:getvalueof var="backgroundcolor" bean="Profile.preferredColor"
 vartype="java.lang.String">
   <body bgcolor="${backgroundcolor}" >
</dsp:getvalueof>

In this example, the tag sets the backgroundcolor attribute to the value held by the preferredColor property of the Profile component. The preferredColor value is kept as a String. The EL variable renders the backgroundcolor value so the current page background color is set to it. This code sample uses the DSP and JSTL Core tag libraries.

 
loading table of contents...