TagLib: Util

set

Description

The set tag updates the specified property.

Tag Body

JSP

Restrictions

If the name attribute is not specified then uses a parent bean tag to locate the bean on which to operate. The property specifies what to update. The value attribute specifies the string value to update the property; the id attribute specifies the bean object value to update the property. Either value or id must be specified.

Attributes

The tag has the following attributes:

Attribute

Description

Req'd?

name Name of the bean to use. No
property Name of the property to update. Yes
value String value of the property to update. No
id Bean object value of the property to update. No
edit Specifies the edit bean that will be applied to value prior to storage. No

Properties

None.

Example(s)

<%-- set the date time property on parent bean --%>
<util:bean type="java.util.Date">
<util:set property="time" value="0"/>
</util:bean>

<%-- set the date time property on named bean --%>
<util:bean id="date" type="java.util.Date"/>
...
<util:set name="date" property="time" value="0"/>

<%-- set a bean onto another bean property --%>
<util:bean id="one" type="BeanOne"/>
<util:bean id="two" type="Beantwo"/>
<util:set name="two" id="one" property="one"/>