You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Scott Goldstein <sd...@mailandnews.com> on 2003/11/20 06:26:53 UTC

Design Pattern question

I'm new to Struts and I ran into a problem with my first application.  It 
appears that only one form bean can be assigned to a single action.  However, 
I have a situation in which I have one page with a form that leads to another 
page with a form.  Specifically, on Page A, I have a select box.  The user 
selects an item and presses an Edit button.  The Edit button submits the form 
and the user is brought to the next page, Page B, which contains the form used 
to edit the item.

So, if the Edit button leads to an Action, it will pull the selected item from 
a FormBean assigned to the action.  Then, how do I prepopulate the form bean 
for the next page?  Do I have to somehow forward to another Action?  If so, 
how do I carry the selected item over to the new Action?

Thanks for the help.

Scott

 
-----------------------------------------------------
                     Shanje.NET
 The webmaster's 1st choice for Windows 2003 Hosting
               http://www.Shanje.NET/
-----------------------------------------------------


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


Re: Design Pattern question

Posted by Nisith Dash <ni...@tcscal.co.in>.
hi,

Once you have retrieved the data in your action from the form bean, you can
put it in the request scope of the action class execute method.
The same will be available when you get forwarded to the next JSP in the
request scope of the second JSP page which can the be used to
for prepopulation.

----- Original Message -----
From: "Scott Goldstein" <sd...@mailandnews.com>
To: <st...@jakarta.apache.org>
Sent: Thursday, November 20, 2003 10:56 AM
Subject: Design Pattern question


> I'm new to Struts and I ran into a problem with my first application.  It
> appears that only one form bean can be assigned to a single action.
However,
> I have a situation in which I have one page with a form that leads to
another
> page with a form.  Specifically, on Page A, I have a select box.  The user
> selects an item and presses an Edit button.  The Edit button submits the
form
> and the user is brought to the next page, Page B, which contains the form
used
> to edit the item.
>
> So, if the Edit button leads to an Action, it will pull the selected item
from
> a FormBean assigned to the action.  Then, how do I prepopulate the form
bean
> for the next page?  Do I have to somehow forward to another Action?  If
so,
> how do I carry the selected item over to the new Action?
>
> Thanks for the help.
>
> Scott
>
>
> -----------------------------------------------------
>                      Shanje.NET
>  The webmaster's 1st choice for Windows 2003 Hosting
>                http://www.Shanje.NET/
> -----------------------------------------------------
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>