Alex,

Here is one approach. When linking to the generic action class, include the
URI of the page that the link is on as a parameter. For example:

    <% String referrer = request.getRequestURI();
       request.setAttribute("referrer", referrer); %>

    <html:link href="/generic/action/class" paramId="referrer"
     paramName="referrer">Click here</html:link>

Within the action, parse the parameter that designates the referrer, and
construct an ActionForward back to it: For example:

    return new ActionForward(request.getParameter("referrer"));

Error checking code ommitted for the sake of brevity.

David


-----Original Message-----
From: Alex Colic [mailto:[EMAIL PROTECTED]]
Sent: Thursday, August 30, 2001 4:04 PM
To: Struts
Subject: How to generically forward to page you came from?


Hi,

I am creating a generic action class that after it is finished it needs to
forward to the page that called it. I have tried "mapping.getInput()" but
obviously since I haven't specified a input page in the struts.xml for the
action class I can't use that. Any thoughts?

Alex

Reply via email to