You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Jen <xh...@yahoo.com> on 2004/07/01 00:38:36 UTC

RE: newbie question: form initialization and process,

> > 
> > What I want to say is normally SubmitFormAction
> will
> > return a jsp page, but this returned jsp
> page(let's
> > call it form2.jsp) also needs initialize, so route
> > will be:
> >
>
ShowFormAction->form.jsp->SubmitFormAction->ShowForm2Action->f
> > or2.jsp->SubmitForm2Action
> > so every submit action will return an action
> instead
> > of a jsp page. potentially the number of actions
> > double the number of form jsps. what I do in my
> own
> > models, my handler handles both initialize and
> > process.
> 
> That works to :)  
> 
 
Is there a better alternative?

> > I guess I have to make the form to be session
scope?
> 
> No not necessarily.  You could put the form bean in
> request scope in the submit action, and then 
> display that.  However, it might be better to go
> ahead and extract your model bean from the form bean
> in the submit action, and then put the model bean
> into session scope and disply there.  That will
> provide you a better way to seperate the UI from the
> data I think.  It will also make it easier to format
> field nicely etc.  The problem is if the user
> decides to change something, then you have to push
> the model back into the form and resdisplay.
> I would also, in the confirmation action, null out
> the session scope attribute you've created since
> you're done with it.
> 
I my case there is an Edit button on confirm page. If
I set the form bean be request scope, when the Edit
button pressed, there is no actual form, how can I
populate the data again?
I like the Struts form bean idea just because it
doesn't interfer with model bean, I only save to model
bean if the user finally clicked confirm.

Thanks


		
__________________________________
Do you Yahoo!?
Yahoo! Mail - 50x more storage than other providers!
http://promotions.yahoo.com/new_mail

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org