Struts Bean - <bean:define> Tag

Define a scripting variable based on the value(s) of the specified bean property.

Attributes

id
Specifies the name of the scripting variable (and associated page scope attribute) that will be made available with the value of the specified property.
name
Specifies the attribute name of the bean whose property is accessed to define a new page scope attribute (if property is also specified) or the attribute name of the bean that is duplicated with the new reference created by this tag (if property is not also specified). This attribute is required unless you specify a value attribute or nested body content.
property
Specifies the name of the property to be accessed on the bean specified by name. This value may be a simple, indexed, or nested property reference expression. If not specified, the bean identified by name is given a new reference identified by id .
scope
Specifies the variable scope searched to retrieve the bean specified by name. If not specified, the default rules applied by PageContext.findAttribute() are applied.
toScope
Specifies the variable scope into which the newly defined bean will be created. If not specified, the bean will be created in page scope .
type
Specifies the fully qualified class name of the value to be exposed as the id attribute.
value
The java.lang.String value to which the exposed bean should be set. This attribute is required unless you specify the name attribute or nested body content.

Attributes

Create a new attribute (in the scope specified by the toScope property, if any), and a corresponding scripting variable, both of which are named by the value of the id attribute. The corresponding value to which this new attribute (and scripting variable) is set are specified via use of exactly one of the following approaches (trying to use more than one will result in a JspException being thrown):

The <bean:define> tag differs from <jsp:useBean> in several ways, including:

Note: There is a restriction in the JSP 1.1 Specification that disallows using the same value for an id attribute more than once in a single JSP page. Therefore, you will not be able to use <bean:define> for the same bean name more than once in a single page.

For more information about Bean creation differences, as well as alternative approaches to introducing beans into a JSP page, see the Bean Developer's Guide section on the Apache Organization web site at http://struts.apache.org/api/org/apache/struts/taglib/bean/package-summary.html#doc.Creation .


About the Struts Custom Tag Libraries in JDeveloper
Reference: Struts Tag Libraries
Reference: Struts Bean Tag Library