Sets a bean property or page parameter.
<dsp:setvaluetarget-spec
[
source-spec
]
/>
Attributes
target-spec
Specifies the bean property or page parameter to set with one of the following attributes:
Attribute | Set to… |
---|---|
| Nucleus path, component name, and property name |
| Page parameter |
The property specification can also include a tag converter, such as date or null. For more information, see Tag Converters in Chapter 2.
source-spec
Specifies the value source as a JavaBean component, Page parameter, or Static value, as follows:
beanvalue="
property
-
spec
"
Specifies a property value, where
property-spec
includes a Nucleus path, component name, and property name. For example:param="name" beanvalue="Student_01.name"
param="
param-name
"
Specifies the value from the page parameter
param-name
. For example:bean="Student_01.enrollmentDate" paramvalue="today"
value="
static-value
"
Specifies a static value. For example:
bean="Student_01.juniorHighSchool" value="Roosevelt"
bean="Student_01.juniorHighSchool" value="true"
Usage Notes
dsp:setvalue
lets you set a bean property or page parameter with a value copied from another bean property, page parameter, or constant. If no value is specified, the variable is set to null.
Example
<dsp:setvalue bean="Student_01.name" paramvalue="currentName"/>
<dsp:setvalue param="graduationDate" value="June 12, 2002"
date="M/dd/yyyy/">
This example assumes that the currentName
page parameter has been previously set to a value. That value is copied to the name
property of the Student_01
component by the first dsp:setvalue
tag. The second tag sets the constant June 12, 2002
to page parameter graduationDate
and formats that date so it is saved as 6/12/2002
.