Tag: set

The wcf:set tag adds values into an object, such as Collections or Maps, that is created with the wcf:useBean tag.

Tag information

Tag information
Body Content empty

Attributes

Attributes

Name Required Request-time Type Description
value true true java.lang.Object The value that is to be inserted into the list or map that is created with the wcf:useBean tag.
target true true java.util.List or java.util.Map The list or map object that the value is to be inserted within.
key false true java.lang.Object The key of the value in the map object. This attribute is required when the target is an instance of a map.
index false true java.lang.Integer The index at which the value is to be inserted into a list object.

Variables

No variables are defined for the wcf:set tag.

Example

The following example creates an ArrayList to save catalog entry names
<wcf:useBean var="catEntryNames" classname="java.util.ArrayList"/>
// Add 2 values into list.
<wcf:set target="${catEntryNames}" value="catEntry1"/>
<wcf:set target="${catEntryNames}" value="catEntry2"/>