Sets a bean property or page parameter.

<dsp:setvalue target-spec [source-spec] />

Attributes

target-spec

Specifies the bean property or page parameter to set with one of the following attributes:

Attribute

Set to…

bean

Nucleus path, component name, and property name

param

Page parameter

The property specification can also include a tag converter, such as date or null. For more information, see Tag Converters.

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.


Copyright © 1997, 2012 Oracle and/or its affiliates. All rights reserved.

Legal Notices