You can try something like below where the local action mapping maps to an
action.
<forward name="success" path="/detailAcct"/>


        //return to a chained action
        //Note: if for some reason the success is changed from a mapped
        //action to a jsp page expect some nasty errors here.
        ActionForward actionForward = mapping.findForward("success");
        ActionMappings mappings = mapping.getMappings();
        String returnPath = actionForward.getPath();
        ActionMapping finalMapping = mappings.findMapping(returnPath);
        EraAction finalAction = null;
        try {
            Class clazz = Class.forName(finalMapping.getType());
            finalAction = (Action) clazz.newInstance();
        }
        catch (Exception e) {
            cat.warn("Could not find chained action: " + e.getMessage());
            cs.setAttribute("accountForm",formInstance);
            return mapping.findForward("error");
        } //end try catch

        return
finalAction.perform(finalMapping,formInstance,request,response);

-----Original Message-----
From: Scott A. Roehrig [mailto:[EMAIL PROTECTED]]
Sent: Saturday, December 01, 2001 10:59 PM
To: [EMAIL PROTECTED]
Subject: ActionForward to anything other than a jsp


Hi:

I have read the archives and have seen some posts and responses to this
question, but was hoping something more definitive might be posted.

Within an ActionA, I would like to forward to another ActionB to
continue processing. Sounds reasonable. So, I look up the javadoc and
see the section about ActionForward and think okay I would simply do the
following in the first action

ActionForward forward = new ActionForward("/ActionServlet/ActionB");

return forward;

Well, so far no luck to say the least. I seem to always get 404 errors
that the page can't be found. I have seen a post about bypassing the
ActionForward and using the request.getRequestDispatcher and have not
tried that yet since it seemed so logical that the ActionForward method
should work.

No go, the only workaround I found was to have the forward to a .jsp
page that did a <jsp:forward> to the actual action.

Can someone please let me know. Can an Action forward to another Action
instead of a JSP page and if so why does the above method not work?

Thanks for any guidance.

Scott

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

Reply via email to