You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Craig R. McClanahan" <cr...@apache.org> on 2002/12/02 02:12:48 UTC

Re: Populating multiple forms from one action class


On Fri, 29 Nov 2002, Curtney Jacobs wrote:

> Date: Fri, 29 Nov 2002 11:43:24 +0000
> From: Curtney Jacobs <te...@attbi.com>
> Reply-To: Struts Users Mailing List <st...@jakarta.apache.org>,
>      technomage@attbi.com
> To: Struts Users Mailing List <st...@jakarta.apache.org>
> Subject: Re: Populating multiple forms from one action class
>
> Greetings!!
>
> I understand what you are saying. However,  I was thinking that  it might be
> possible to pre-populate the ActionForms with a generic action class (not
> tied to any particular form) and put them in the current session.
>
> The following is an excerpt from "Mastering Jakarta Struts" that supports my
> idea.
>
>
>
> " if the sesion already includes an instance of the ActionForm named by
> the <form> element's name attribute, then the values stored in its data
> members 	will be used to prepopulate the input values. "
>

Prepopulating input forms this way (by setting up the form bean in an
Action that preceeds the display of the form) is a very standard approach
in Struts based applications.  It's a perfectly reasonable thing to do.

Whether you do it with a generic Action, or a customized Action for each
type of form is pretty much up to you.

>
>
> If anyone else have any opinions on this please don't be afraid to comment :-)
>
> Thanks in advance,
>
> Curtney Jacobs

Craig


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>