Hal,
Thanks, but still doesn't work - default is false anyway.
If I specifically grab the form I stick in the request object , and fill that
one, then my jsp will use that fine! BUT, Struts should use that one!!
Appreciate any other ideas...
Dave
"Deadman, Hal" <[EMAIL PROTECTED]> on 04/11/2001
06:07:32 PM
Please respond to [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
cc: (bcc: David Hay/Lex/Lexmark)
Subject: RE: Confusion with form beans
I am not sure what the default is but you should specify redirect="false" if
you are passing things on the request object. That will cause a forward
instead of a redirect. If the default for redirect is true then the
/ShowLog.do action will be requested with a new request.
<forward name="success" path="/ShowLog.do" redirect="false" />
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, April 11, 2001 6:02 PM
> To: [EMAIL PROTECTED]
> Subject: RE: Confusion with form beans
>
>
>
>
> Craig,
>
> Thanks for that. I'd been passing stuff as session var's,
> but grabbing the next
> page's form is much cleaner.
>
> Having problems getting it working though - seems to be
> creating a blank new
> form in the action I forward to.
>
> In the action after the first page is submitted, I did the following:
>
> //set parameters we need for next page in it's form bean
> LogForm logForm = new LogForm();
> logForm.setFilename(filename);
> logForm.setEntryPoints(entryPoints);
> //add in request scope
> request.setAttribute("LogForm", logForm);
>
> // Forward control to the parameters page
> return(mapping.findForward("success"));
>
> (have in struts_config: <forward name="success"
> path="/ShowLog.do" />
> for this action)
>
> However, when I grab the form that I get in the
> ShowLogAction, it seems to
> create a new blank form. If I actually get
> the form from the request object by doing
> LogForm myLogForm = (LogForm) request.getAttribute("LogForm");
> I do get the form I created! The name of the form in
> struts-config is LogForm -
> so don't understand it.
>
> Any ideas?
>
> Dave
>
>
>
>
>
> "Craig R. McClanahan"
> <[EMAIL PROTECTED]> on 04/09/2001
> 10:47:46 PM
>
> Please respond to [EMAIL PROTECTED]
>
> To: [EMAIL PROTECTED]
> cc: (bcc: David Hay/Lex/Lexmark)
> Subject: RE: Confusion with form beans
>
>
>
>
>
> On Wed, 4 Apr 2001 [EMAIL PROTECTED] wrote:
>
> >
> >
> > Nigel,
> >
> > Hi. Just to confirm...I would really like to have access
> to the first form in
> > the action that creates the second form. Can I do that, or
> do I have to pass
> > the info in as parameters? ie will the first bean PERSIST
> in the session so I
> > can access it in the following action? It seems that the
> persisting way is
> much
> > cleaner.
> >
> > Please let me know if that doesn't make sense!!
> >
> > Dave
> >
>
> I *think* the following approach is what you are asking for:
>
> * Two forms, "form1.jsp" and "form2.jsp".
>
> * Each form has an associated bean ("form1Bean" and "form2Bean").
>
> * Have the "form1.jsp" page submit to an action "/saveForm1".
>
> * The corresponding Action for "/saveForm1" can then:
> - Receive the form1Bean bean that contains the form1.jsp fields
> - Create a new form2Bean instance, and store it in request scope
> - Forward to "form2.jsp"
>
> * Now, the bean for "form2.jsp" will be pre-initialized, based on
> whatever processing was done by the Action. This can, of course,
> including things like copying values from the form1Bean instance.
>
> Craig McClanahan
>
>
>
>
>
>
>