is this struts 1.x form bean in session scope or request scope?

本文解析了Struts 1.x框架中Form Bean的作用域配置,默认情况下Form Bean的作用域为session,可通过<action>元素中的scope属性进行自定义设置。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

http://stackoverflow.com/questions/6795959/is-this-struts-1-x-form-bean-in-session-scope-or-request-scope


If unspecified, by default an ActionForm will have scope session.

The scope of an ActionForm is specified on the <action> configuration as attribute scope. You can find this in the Struts DTD:

The "action" element describes an ActionMapping object that is to be used
     to process a request for a specific module-relative URI. The following
     attributes are defined:
     .....
     .....
     scope           The context ("request" or "session") that is used to
                     access our ActionForm bean, if any.  Optional if "name" is
                     specified, else not valid. [session]
     .....
     .....

This value is initialized in the org.apache.struts.config.ActionConfig class which represents the configuration information of an element from a Struts module configuration file:

/**
 * <p> Identifier of the scope ("request" or "session") within which our
 * form bean is accessed, if any. </p>
 */
protected String scope = "session";

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值