In your example, if the app servers have the same set of configuration
items, then you only need one ActionForm class to represent that common set
of items. One of the properties of your form bean would be the identifier
you use to identify the particular app server associated with a request. You
can use a hidden field on your JSP pages to make sure that the identifier is
sent back with the request, so you do not need to maintain state on the
server.
The ActionForm class is the base class to use for all of your Struts
application's form beans. The ActionFormBean is an internal class used to
manage form beans inside of Struts. You should never need to worry about it.
Hope this helps.
--
Martin Cooper
----- Original Message -----
From: "Sarbjit Singh" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, March 07, 2001 9:54 AM
Subject: Re: Parallel Forms Bean Instances, does Struts support it
Hi, thanks for the quick reply/
That would be ok if we had a well defined number of services.
These services are dinamically created by the user.
For example:
Do give a scop of what i am trying to do:
Imagine an application that would allow you to create and mantain
multiple Instances of a XYZ Servers (Web,Direcotry,appserver, whatever)
in a particular host.
The administrator wanted to instanciate lets say an app server to run on
port 8080 and it used this web application to make/edit this
configuration. Than hi also creates another instance throug this web
application, this one to run on port 18080. This two seperates
instances could be managed with the same application server. The would
have the same set of configuration items however their configuration is
disjoint.
The thing is, i cannont predifine Id's to actions/forms. because that
number of instances of servers dynamically grows as the user may create
or delete server instances.
Also a user may be editing many server info at the same time. (in
separate windows but sharing the same sesssion)
BTW, what is the purpose/difference of:
ActionForm and ActionFormBean?
----- Original Message -----
From: Nanduri, Amarnath <mailto:[EMAIL PROTECTED]>
To: '[EMAIL PROTECTED]'
<mailto:'[EMAIL PROTECTED]'>
Sent: Wednesday, March 07, 2001 10:00 AM
Subject: RE: Parallel Forms Bean Instances, does Struts support it
Correct me if i am wrong.... One way to do it would be to give 'request'
scope to the form.
In the Action class, you set the form to a session scope, under a
different key...one for each different service. Make sure that only one
kind of Action can handle one kind of service. i.e for Service A, use
Action A and for Service B use Action B. In your action classes set the
scope of
forms to session (using different keys). Also in your struts-config.xml
file, set the scope (for every action) to request.
cheers,
Amar..
-----Original Message-----
From: Sarbjit Singh [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, March 07, 2001 10:50 AM
To: [EMAIL PROTECTED]
Subject: Parallel Forms Bean Instances, does Struts support it
Hello, I am new to Struts.
One thing that is key in making a decision on weather to use or not to
use
Struts is this.
Suppose I have an ActionForm with class type com.myapp.MyServiceForm.
This would be a form bean that would represent some sortr of service in
an application that is supposed to control system services.
Is there a way or is Struts able to distinguish 2 instances of the
MyServiceForm , one for service A and one for Service B.
My interpretation of the the Source Code is that the ActionFormBeans
class only cashes one copy of the form class keyed off by the logical
name of the form.
How would you deal with relating the aproriate bean to a form when you
have multiple instances of the form bean.... Am i looking at it from the
wrong perspective?
Thanks for in info.
Thanks