Re: FormAction scope

2001-01-26 Thread Craig R. McClanahan

Zhiyong Li wrote:

> I understand that the default scope of the "FormAction" bean is
> "session", which means that only one "FormAction" bean instance will be
> created for each session.

Actually, it would be one FormAction bean for a particular bean *name* per
session.  The various form beans for different forms would not interfere with
each other, unless you used the same form bean name.

> Is there a way to specify the scope of the
> "FormAction" to be "request"?

You can declare this in the struts-config.xml file.  For example, the Struts
Example application does so on all of the form beans it uses:



In most cases, your Action classes will not have to care about which scope is
currently being used, since the FormBean instance is passed to your
Action.perform() method as a parameter.  The controller servlet, and the
 tag, both look up or create the bean in the scope specified here
automatically.

> We probably can do this with Struts's form
> tag. But that is not what I want. In my case, this "FormAction" bean may
> be invoked from a href in addition to the forms.
>
> Thx,
> Zhiyong Li
>

Craig McClanahan





Re: FormAction scope

2001-01-26 Thread Ted Husted

You may wish to consider using another bean within the FormAction to
accomplish your goal. 

Just a suggestion. Your mileage will vary.

*** REPLY SEPARATOR  ***

On 1/26/2001 at 12:59 PM Zhiyong Li wrote:

I understand that the default scope of the "FormAction" bean is
"session", which means that only one "FormAction" bean instance will be
created for each session. Is there a way to specify the scope of the
"FormAction" to be "request"? We probably can do this with Struts's
form
tag. But that is not what I want. In my case, this "FormAction" bean
may
be invoked from a href in addition to the forms. 

Thx,
Zhiyong Li
Platform Development
iBiomatics LLC ,  a SAS Company
(919) 653-2746
[EMAIL PROTECTED]



-- Ted Husted, Husted dot Com, Fairport NY USA.
-- Custom Software ~ Technical Services.
-- Tel 716 425-0252; Fax 716 223-2506.
-- http://www.husted.com/about/struts/





FormAction scope

2001-01-26 Thread Zhiyong Li

I understand that the default scope of the "FormAction" bean is
"session", which means that only one "FormAction" bean instance will be
created for each session. Is there a way to specify the scope of the
"FormAction" to be "request"? We probably can do this with Struts's form
tag. But that is not what I want. In my case, this "FormAction" bean may
be invoked from a href in addition to the forms. 

Thx,
Zhiyong Li
Platform Development
iBiomatics LLC ,  a SAS Company
(919) 653-2746
[EMAIL PROTECTED]