You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Xavier Combelle <xc...@kaptech.com> on 2002/10/29 17:25:34 UTC

how many form for update and create action ?

I have a conceptual problem in my struts application

I am programming an application which give the possibility
to create, update and delete several information, for exemple 
the name and the price of an item.

So I need to give to the user two possibilities :
 1- the possibility to create an item
 2- the possibility to update an item
so i use two action, one for each possibility

Should I use the same form bean to update and create or
should I use different form bean, one for update and one for create ?
and if I should use different form bean, should they have the same type ?

Greetings,

Xavier

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


Re: how many form for update and create action ?

Posted by "Craig R. McClanahan" <cr...@apache.org>.
On Tue, 29 Oct 2002, Xavier Combelle wrote:

> Date: Tue, 29 Oct 2002 17:25:34 +0100
> From: Xavier Combelle <xc...@kaptech.com>
> Reply-To: Struts Users Mailing List <st...@jakarta.apache.org>
> To: struts-user@jakarta.apache.org
> Subject: how many form for update and create action ?
>
> I have a conceptual problem in my struts application
>
> I am programming an application which give the possibility
> to create, update and delete several information, for exemple
> the name and the price of an item.
>
> So I need to give to the user two possibilities :
>  1- the possibility to create an item
>  2- the possibility to update an item
> so i use two action, one for each possibility
>
> Should I use the same form bean to update and create or
> should I use different form bean, one for update and one for create ?
> and if I should use different form bean, should they have the same type ?
>

The struts-example application (that ships with Struts) illustrates one
approach to this problem.  It uses the same form bean for both create and
edit (SubscriptionForm), and the same setup action
(SetupSubscriptionAction) and save-to-database action
(SaveSubscriptionAction) for both create and edit functions.  I chose to
use an "action" property, included in the form bean and the various URLs,
to indicate which type of transaction was to be performed.

> Greetings,
>
> Xavier

Craig


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