<jsp:useBean>
documentation (page 35).这是相关的摘录:
class="package.class" type="package.class"
Instantiates a bean from the class named in
class
and assigns the bean the data type you specify intype
. The value oftype
can be the same asclass
, a superclass ofclass
, or an interface implemented byclass
.The class you specify in
class
must not be abstract and must have a public, no-argument constructor. The package and class names you use with bothclass
andtype
are case sensitive.
beanName="{package.class | <%= expression %>}" type="package.class"
Instantiates a bean from a class, a serialized template, or an expression that evaluates to a class or serialized template. When you use
beanName
, the bean is instantiated by thejava.beans.Beans.instantiate
method. TheBeans.instantiate
method checks whether the package and class you specify represents a class or a serialized template. If they represent a serialized template,Beans.instantiate
reads the serialized form (which has a name likepackage.class.ser
) using a class loader.The value of
type
can be the same asbeanName
, a superclass ofbeanName
, or an interface implemented bybeanName
. The package and class names you use with bothbeanName
andtype
are case sensitive.