Tag: useBean
The
wcf:useBean tag creates a list or map object.
| Tag information | |
|---|---|
| Body Content | empty |
Attributes
| Attribute | Required | Request-time | Type | Description |
|---|---|---|---|---|
var |
true |
true |
java.lang.String |
The name of the scoped instance variable. |
scope |
false |
false |
java.lang.String |
The scope for the instance variables that are specified by the var
attribute. The scope values are page, request,
session, application. The default value is
page. |
classname |
true |
true |
java.lang.String |
The classname for which the instance is to be created.
The value can be either List or Map. |
capacity |
false |
true |
java.lang.Integer |
The initial capacity of the list or map instance to be created. |
Variables
No variables are defined for the wcf:useBean tag.
Example
The following example uses the
wcf:useBean tag to define a HashMap that has the
name "cachedCategoryViewMap". This HashMap holds category view objects within the
request
scope:<wcf:useBean var="cachedCategoryViewMap" classname="java.util.HashMap" scope="request"/>The following example uses the
wcf:useBean tag to define a list that is to
include the "brands" that are within the page
scope:<wcf:useBean var="brands" classname="java.util.ArrayList"/>