You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Andrew van der Voort <an...@astarte.co.nz> on 2003/08/20 01:17:56 UTC
Defining inheritance for dynamic action forms in struts-config
We have recently upgraded to Struts 1.1 and are exploring the new features.
I have dynamic action forms and validator working.
Many of our forms have several attributes in common. In struts 1.0.x we
defined a class inheriting from ActionForm (MainActionForm), defined those
attributes in it, and extended our ActionForms from MainActionForm.
With dynamic forms there is no base class. It is all defined in
struts-config. Can I defined anything in struts-config and have all the
relevant dynamic forms refer to, or include that base definition?
I know I could define a MainDynaActionForm and add the relevant attributes
to the hashmap at construction and initialisation time, but then its no
longer dynamic as I'd have to change code to add or remove one of the
common attributes.
Can I do what I'm describing above?
Thanks
Andrew
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
Re: Defining inheritance for dynamic action forms in struts-config
Posted by "Craig R. McClanahan" <cr...@apache.org>.
On Wed, 20 Aug 2003, Andrew van der Voort wrote:
> Date: Wed, 20 Aug 2003 11:17:56 +1200
> From: Andrew van der Voort <an...@astarte.co.nz>
> Reply-To: Struts Users Mailing List <st...@jakarta.apache.org>
> To: "Struts-User-Help (E-mail)" <st...@jakarta.apache.org>
> Subject: Defining inheritance for dynamic action forms in struts-config
>
> We have recently upgraded to Struts 1.1 and are exploring the new features.
> I have dynamic action forms and validator working.
>
> Many of our forms have several attributes in common. In struts 1.0.x we
> defined a class inheriting from ActionForm (MainActionForm), defined those
> attributes in it, and extended our ActionForms from MainActionForm.
>
> With dynamic forms there is no base class. It is all defined in
> struts-config. Can I defined anything in struts-config and have all the
> relevant dynamic forms refer to, or include that base definition?
>
> I know I could define a MainDynaActionForm and add the relevant attributes
> to the hashmap at construction and initialisation time, but then its no
> longer dynamic as I'd have to change code to add or remove one of the
> common attributes.
>
> Can I do what I'm describing above?
>
Not without an enhancement to the current functionality -- maybe something
along the way that Tiles lets you extend other tile definitions. The best
way to ensure that this gets addressed would be to submit an enhancement
request into our bug tracking system:
http://nagoya.apache.org/bugzilla/
> Thanks
>
> Andrew
>
Craig
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org