On Wed, 6 Jun 2001, John Hogan wrote:

> All,
> 
> I have a situation where it is desirable to use a form/page for both 
> adding new info and editing existing data.  The new info scenario is 
> straight forward struts ActionForm/Action classes.  What I'm 
> wrestling with a bit is the edit scenario.  I'm wondering if I can 
> stay within the struts framework and still do something like entering 
> a page in edit mode and have it displaying existing user data?
> 
> It seems this should be possible because that's exactly what the page 
> does for error handling.  Has anyone else tackled this one yet?  TIA.
> 
> JohnH
> 
> _____________________________________
> 
> Get your free E-mail at http://www.ireland.com
> 

The Struts example application includes logic that does exactly what you
describe -- the same page (subscription.jsp) is used to add new
subscriptions, edit old ones, and confirm deletion of old ones.  For the
edit case, the trick was to forward to an Action that created a form bean
prepopulated with the values from the database object, and then forward to
the page.

Craig


Reply via email to