And Struts 1.3 will make it much easier to setup your form bean
declarations in struts-config.xml when you do this :-) But note that
having a shared form bean and having a common parent class don't achieve
the same thing.
A shared form bean means having a single instance of a particular bean
that you can refer to from different contexts and always see the same
data. Having a superclass only shares the *structure*, not the data; you
would still need to use a shared bean of some type to get shared data.
In other words, one's not an alternative to the other, they're seperate
concerns. You can use either or both to achieve different things, but a
shared parent class doesn't automatically give you shared data.
L.
atta-ur rehman wrote:
Hi Starky,
Yes, I'd think that having a common super class for a set of form classes
that all have some common fields should be a good idea. Not only you get
shared fields but also reset() and validate() can be reused in subclasses,
for example.
ATTA
On 10/27/05, starki78 <[EMAIL PROTECTED]> wrote:
Thank you for your answer!
But if you have a shared form bean, would it also
be an alternative to have a super class form
bean with the shared paramters and the heritaged
subclasses?
Nice greetings
Starky
---------- Initial Header -----------
From : "Wendy Smoak" [EMAIL PROTECTED]
To : "Struts Users Mailing List" user@struts.apache.org
Cc :
Date : Wed, 26 Oct 2005 09:44:54 -0700
Subject : Re: how to copy the properties of one Struts form-bean to
another?
From: "starki78" <[EMAIL PROTECTED]>
thanks that was what I was exactly looking for!
If you find yourself copying properties from form to form too much, you
might consider consolidating the forms.
One of my Struts apps uses a single session-scoped form bean across the
entire app. It's a front end for accounting reports, so in this way I'm
able to easily 'remember' the list of accounts and other settings the
person
was working with, no matter which report they're requesting.
--
Wendy Smoak
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]