JSP语法(12)
发表于:2007-07-14来源:作者:点击数:
标签:
jsp:useBean 创建一个Bean实例并指定它的名字和作用范围. JSP 语法 jsp:useBean id="beanInstanceName" scope="page | request | session | application" { class="package.class" | type="package.class" | class="package.class" type="package.class" | b
<jsp:useBean> 创建一个Bean实例并指定它的名字和作用范围.
JSP 语法
<jsp:useBean
id="beanInstanceName"
scope="page | request | session | application"
{
class="package.class" |
type="package.class" |
class="package.class" type="package.class" |
beanName="{package.class | <%= expression %>}" type="package.class"
}
{
/> |
> other elements </jsp:useBean>
}
例子
<jsp:useBean id="cart" scope="session" class="session.Carts" />
<jsp:setProperty name="cart" property="*" />
<jsp:useBean id="checking" scope="session" class="bank.Checking" >
<jsp:setProperty name="checking" property="balance" value="0.0" />
</jsp:useBean>
原文转自:http://www.ltesting.net