Will Stranathan wrote:

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("&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


It won't work - you'd have to get the ActionForward of where you WERE, which is exactly why I recommended storing the forward in the session before you actually go there.

I was able to make this work!! You're absolutely right though. I realized that I set a bean in my page to handle my navigation so I checked for the value of that "page" and "step" and created the ActionForward based on that! If anyone wants to see I can post some code. Brandon


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



Reply via email to