<snip>
The only difference between the pages is that they call different
actions i.e. 
/order/create/stage1.do vs /order/update/stage1.do
</snip>

Try using DispatchAction: http://husted.com/struts/tips/002.html

You can consolidate your create() and update() 'execute' methods within
one action class.



-----Original Message-----
From: Mark Benussi [mailto:[EMAIL PROTECTED] 
Sent: 12 January 2005 09:30
To: user@struts.apache.org
Subject: Struts design for CRUD methods


I have a web based application which allows the Creation, Update, Read
and 
Deletion of Data objects (Nothing new here).

All data changes are done by calling Manager methods with Action Forms
to 
update the relevant data e.g.

new ShopManager().createOrder(createOrderForm);

or new ShopManager.updateOrder(updateOrderForm);

My problem is that I am having to create duplicate JSPs and actions for
the 
create and update processes. The pages look exactly the same and hold
the 
same values but the difference is that the update actions will pre
populate 
the form with the existing methods and invoke the update method on the 
manager instead of a standard create. Even the forms are identical (The 
update form extends the create form but holds a reference to the data id

that is to be updated).

My question is: Is there a way to have one set of JSPs, Forms and
actions to 
manage all of this. When I change a JSP I am having to maintain two
pages 
which sounds trivial but to me shouts of bad design. The only difference

between the pages is that they call different actions i.e. 
/order/create/stage1.do vs /order/update/stage1.do

I would be interersted to know peoples thoughts.

Cheers,

Mark



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED] 
--------------------------------------------------------
 
If you are not an intended recipient of this e-mail, please notify the sender, 
delete it and do not read, act upon, print, disclose, copy, retain or 
redistribute it. Click here for important additional terms relating to this 
e-mail.     http://www.ml.com/email_terms/ 
--------------------------------------------------------
 

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to