On Mon, 3 Dec 2001, Tim Moore wrote:
> Date: Mon, 3 Dec 2001 11:28:32 -0500
> From: Tim Moore <[EMAIL PROTECTED]>
> Reply-To: Struts Developers List <[EMAIL PROTECTED]>
> To: Struts Developers List <[EMAIL PROTECTED]>
> Subject: RE: Parameters and chaining
>
> This would be very helpful for me! I'm desigining an application with a
> fairly complex internal navigation structure and until the workflow
> commons package is in a more complete state
Working on it as I have time :-)
> I've had to make do with an
> ad hoc scheme that has been seriously hindered by the inability of an
> action to set request parameters on an action that it forwards to. I'm
> ending up having to do redirection to (long, ugly) URLs computed on the
> fly instead of forwards a lot of the time. This suggestion would
> certainly ease that particular pain.
>
Although the typical design pattern is to return the result of calling
mapping.findForward(), you can also create your own instance:
String url = "/context/relative/path.do?name1=value1";
return (new ActionForward(uri));
so you can construct your own. If you don't want to give up the logical
naming feature of ActionForwards, you can do something only slightly more
complicated:
ActionForward forward = mapping.findForward("success");
String url = forward.getPath() + "?name1=value1";
return (new ActionForward(url));
Craig
> --
> Tim Moore / Blackboard Inc. / Software Engineer
> 1899 L Street, NW/ 5th Floor / Washington, DC 20036
> Phone 202-463-4860 ext. 258 / Fax 202-463-4863
>
>
> > -----Original Message-----
> > From: Ted Husted [mailto:[EMAIL PROTECTED]]
> > Sent: Friday, November 30, 2001 9:36 PM
> > To: [EMAIL PROTECTED]
> > Subject: Parameters and chaining
> >
> >
> > Going back to
> >
> > http://www.mail-archive.com/struts-dev@jakarta.apache.org/msg0
> > 1351.html
> >
> > "It would be nice if there was some Struts mechanism so that
> > I could tell Struts "please pass this form bean directly to
> > the target action instead of resetting one and populating it
> > from request parameters". Then my target action wouldn't need
> > to be aware that it was the target of the chain, or that the
> > form bean was hand-crafted."
> >
> > How about if we made a few more things public so you could do
> > something like
> >
> > ActionMapping chainMapping =
> > servlet.processMapping("/do/another/Action",request);
> > Action chainAction =
> > servlet.processActionCreate(chainMapping,request);
> > ActionForward chainForward = servlet.processActionPerform(
> > chainAction,chainMapping,form,request,response);
> >
> > Or added an all-in-one method that did this for you, and just
> > returned a forward
> >
> > ActionForward chainForward = servlet.invokeAction(
> > "/do/another/Action",form,request,response);
> >
> >
> > (Quick, someone talk him down off the ledge.)
> >
> >
> > -- Ted Husted, Husted dot Com, Fairport NY USA.
> > -- Custom Software ~ Technical Services.
> > -- Tel +1 716 737-3463
> > -- http://www.husted.com/struts/
> >
> > --
> > To unsubscribe, e-mail:
> > <mailto:struts-dev-> [EMAIL PROTECTED]>
> > For
> > additional commands,
> > e-mail: <mailto:[EMAIL PROTECTED]>
> >
> >
>
> --
> To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
>
>
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>