InfoCenter Home >
4: Developing applications >
4.2: Building Web applications >
4.2.2: Developing JSP files >
4.2.2.3: Overview of JSP file content >
4.2.2.3.5: JSP syntax: useBean tag >
4.2.2.3.5.1a: JSP .91 syntax: <BEAN> tag syntax
4.2.2.3.5.1a: JSP .91 syntax: <BEAN> tag syntax
<bean name="bean_name" varname="local_bean_name"
type ="class_or_interface_name" introspect="yes|no"
beanName="ser_filename" create="yes|no"
scope="request|session|userprofile" >
</bean>
where the attributes are:
- name
The name used to look up the bean in the appropriate scope (specified by
the scope attribute). For example, this might be the session key value
with which the bean is stored. The value is case-sensitive.
- varname
The name used elsewhere within the JSP file to refer to the bean.
This attribute is optional. The default value is the value of the name
attribute. The value is case-sensitive.
- type
The name of the bean class file. This name is used to
declare the bean instance in the code. The default value is the type
Object. The value is case-sensitive.
- introspect
When the value is yes, the JSP processor examines all request
properties and calls the set property methods (passed in the BeanInfo) that
match the request properties. The default value of this attribute is
yes.
- beanName
The name of the bean class file, the bean package name, or the
serialized file (.ser file) that contains the bean. (This name
is given to the bean instantiator.) This attribute is used only when
the bean is not present in the specified scope and the create attribute is set
to yes. The value is case-sensitive.
The path of the file must be specified in the Web application classpath.
- create
When the value is yes, the JSP processor creates an instance of
the bean if the processor does not find the bean within the specified
scope. The default value is yes.
- scope
The lifetime of the bean. This attribute is optional and the
default value is request. The valid values are:
|
|