Java Reference
In-Depth Information
T ABLE 16.1
The scope attribute represents the life of the object. The scope options are
page , request , session , and application .
The fully qualified classname that defines the implementation of the
object. The classname is case sensitive.
This attribute references the name of the bean, as expected to be instanti-
ated by the instantiate() method of the java.beans.Beans class.
The type attribute specifies the type of scripting variable defined. If this
attribute is unspecified, then the value is the same as the value of the
class attribute.
The <jsp:setProperty> Standard Action
The second standard action to help integrate JavaBeans into JSPs is < jsp:setProperty> . It
sets the value of a bean's property. Its name attribute denotes an object that must already be
defined and in scope. The syntax for the < jsp:setProperty> action is as follows:
<jsp:setProperty name=” beanName prop_expr />
In the preceding syntax, the name attribute represents the name of the bean whose property you
are setting and prop_expr can be represented in the following syntax:
property=”*” |
property=” propertyName ” |
property=” propertyName ” param=” parameterName ” |
property=” propertyName ” value=” propertyValue
Table 16.2 contains the attributes and their descriptions for the < jsp:setProperty> action.
T ABLE 16.2
The Attributes for the < jsp:setProperty> Action
This attribute represents the name of the bean instance defined by a
<jsp:useBean> action or some other action.
This attribute represents the bean property for which you want to set a
value. If you set propertyName to an asterisk (*), then the action will iter-
ate over the current ServletRequest parameters, matching parameter
names and value types to property names and setter method types, and set-
ting each matched property to the value of the matching parameter. If a
parameter has an empty string for a value, the corresponding property is
left unmodified.
Search WWH ::

Custom Search