Will Stranathan wrote:
Hello again,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:
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("&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]