This is all cool, but, I think, overly complicated for what you need. 
I think a better solution, simpler and less archane, would be to
create a helper class that constructs the appropriate ActionForward
given your needs/rules.

SomeAction extends Action with execute(...) { .... return
ActionForwardCreator.createActionForward(...[parameters]...); }

Jack


On Thu, 20 Jan 2005 10:30:42 -0500, Brandon Mercer <[EMAIL PROTECTED]> wrote:
> Will Stranathan wrote:
> 
> > On Wed, 19 Jan 2005 22:16:34 -0800
> >  Dakota Jack <[EMAIL PROTECTED]> wrote:
> >
> >> <snip>
> >>
> >>>
> >>> > 2) Specify a <forward /> for the Action that sends the user back to
> >>> > from whence they came.
> >>>
> >>> I don't think I can do this because they may come from a number of
> >>> pages.
> >>>
> >> </snip>
> >>
> >> You can specify a dynamic ActionForward return in your Action class
> >> execute(...) method.  Not sure why this presents any difficulty at
> >> all.
> >>
> >> Jack
> >
> >
> > My apologies for not reading first - yeah - use a dynamic one like
> > jack said.  I would PROBABLY subclass Action with an abstract subclass
> > - something like:
> >
> Hello again,
> I've found this interesting and seemingly useful piece of information in
> a struts book I recently obtained.
> 
> Dynamic Forwards
> 
> ActionForward forward = new ActionForward("/do/itemEdit?action=edit");
> 
> Then it goes on to tell me to use the runtime parameter techniques in
> the previous sections to help build my ActionForward path.  There are
> two techniques:
> 
> Adding parameters in the page
> or
> Adding parameters in the Action class:
> 
> ActionForward forward = mapping.findForward("article");
> StringBuffer path = new StringBuffer(forward.getPath());
> boolean isQuery = (path.indexOf("?")>=0);
> if (isQuery)
>        path.append("&amp;dispatch=view");
> else
>        path.append("?dispatch=view"0;
> 
> return new ActionForward(path.toString());
> 
> Ok, so having that found out... and with what you've given me from above
> can I do something like this?
> 
> ::regular class stuff::
> 
> String previouspath = request.getSession(forward.getPath());
> 
> ActionForward forward = new ActionForward(previouspath);
> 
> ::regular class end::
> 
> I'm going to try it out... if anyone sees me doing some really bad stuff
> feel free to slap my wrists :-P.
> Brandon
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 


-- 
------------------------------

"You can lead a horse to water but you cannot make it float on its back."

~Dakota Jack~

"You can't wake a person who is pretending to be asleep."

~Native Proverb~

"Each man is good in His sight. It is not necessary for eagles to be crows."

~Hunkesni (Sitting Bull), Hunkpapa Sioux~

-----------------------------------------------

"This message may contain confidential and/or privileged information.
If you are not the addressee or authorized to receive this for the
addressee, you must not use, copy, disclose, or take any action based
on this message or any information herein. If you have received this
message in error, please advise the sender immediately by reply e-mail
and delete this message. Thank you for your cooperation."

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to