You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Susan Bradeen <Su...@softlanding.com> on 2003/05/01 14:01:42 UTC

RE: Basic struts tag question related to formbeans

On 04/30/2003 05:40:48 PM "Neale, Bennett" wrote:

> Yes it is alright, but based on his remark:
> 
> > My intent is that control be forwarded right back to Action1, so that
> > form.jsp will show up again, but this time with:
> >     * the form fields populated with the user's just-entered input
> values
> >     * various html errors output
> 
> I was under assumption that he was not prepopulating or setting up any
> jsp
> fields and just wanted to display form.jsp, which wouldn't require
> forwarding to Action1. Sorry for any confusion!
>

Yes, I definitely agree that using the jsp as the input parameter is the 
way to go if there is no reason to go through the action again. Sorry, 
Bennett, your response was not in question (no need for your apologies!), 
I apparently just picked your post to reply to. Thanks for the 
clarification. 

Susan Bradeen

> Bennett
> 
> 
> -----Original Message-----
> From: Susan Bradeen [mailto:SusanB@softlanding.com]
> Sent: Wednesday, April 30, 2003 1:43 PM
> To: Struts Users Mailing List
> Subject: RE: Basic struts tag question related to formbeans
> 
> Well, wait a minute. Isn't it perfectly alright to have your Action1 as
> the value for the input attribute in Action2's mapping? Haven't we been
> through this discussion before? (Not directed to you, Laird).
> 
> If you change the input to be the jsp, it should work fine. One of the
> reasons for using the Action1 as the input is to set up other fields the
> 
> jsp displays, but does not send with the submitted request (lists for
> drop
> boxes, etc). I guess you'd have to be careful however that Action1
> doesn't
> reinitialize your form fields to blanks or something, in which case they
> 
> are not displayed when coming back from a failed validation. I am not
> sure
> this is considered to be action chaining, although technically it does
> go
> from one action to another. I believe there are people on this list who
> are doing this successfully. Your Action1 has name="someFormBean"
> defined
> in its mapping also, right?
> 
> Susan Bradeen
> 
> On 04/30/2003 02:54:26 PM "Neale, Bennett" wrote:
> 
> > You should have the input set to the form jsp:
> > <action path="/action2" name="someFormBean" scope="request"
> > input="/form.jsp"...>
> >
> > Bennett
> >
> > -----Original Message-----
> > From: Nelson, Laird [mailto:Laird.Nelson@FMR.COM]
> > Sent: Wednesday, April 30, 2003 11:47 AM
> > To: 'struts-user@jakarta.apache.org'
> > Subject: Basic struts tag question related to formbeans
> >
> > This is such a basic question I'm embarrassed to ask it, but I really
> > couldn't figure out the answer from the user guides.  Oh well; here
> > goes.
> >
> > I've got an Action that displays a form:
> > Action1 --> form.jsp
> > That form submits to another Action that processes it:
> > form.jsp --> Action2
> > So in my struts-config.xml I've got a form bean set up on Action2 with
> > request scope:
> > <action path="/action2" name="someFormBean" scope="request"
> > input="/action1"...>
> > The intent, as I understand it, is to provide a bean that represents
> the
> > form on form.jsp to the Action (Action2) that's processing it.  No
> > problems so far.
> >
> > Now when my form bean performs validation, and when validation fails,
> > the form bean creates an ActionErrors and returns it.  Struts
> obligingly
> > consults the "input" attribute to figure out where to forward control.
> > My intent is that control be forwarded right back to Action1, so that
> > form.jsp will show up again, but this time with:
> > *         the form fields populated with the user's just-entered input
> > values
> > *         various html errors output
> > What happens is that form.jsp shows up with the html errors output,
> but
> > the values in the form fields aren't prefilled.
> >
> > Do I need to declare the same formbean on both Action2 and Action1?
> >
> > Humbly,
> > Laird
> > --
> > Laird J. Nelson
> > Electronic Channel Group, Fidelity eBusiness (Veritude)
> > * (508) 357-3142
> > * laird.nelson@fmr.com
> > * 1075462@skytel.com <ma...@skytel.com>
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
> 

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