You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Justin Moore <JM...@ecount.com> on 2005/02/18 18:29:00 UTC

Linking DispatchActions

Hello Everyone,

I have a question about linking DispatchActions.  I have two DispatchActions (Action1 and Action2).  Both Actions have the same method signatures that look like this:
------------------------------------------------------------------------------------------
public class Action1 extends DispatchAction{

	public ActionForward unspecified(ActionMapping mapping,ActionForm form,HttpServletRequest request, HttpServletResponse response) throws Exception
    	{
	        return method1(mapping, form, request, response);
    	}

	public ActionForward method1(ActionMapping mapping,ActionForm form,HttpServletRequest request, HttpServletResponse response) throws Exception
    	{
	       ...etc...

    	}

	public ActionForward method2(ActionMapping mapping,ActionForm form,HttpServletRequest request, HttpServletResponse response) throws Exception
    	{
	       ...etc...

    	}
}
------------------------------------------------------------------------------------------

Method 1 is used for setting up the page, and Method 2 is used for processing the page. 


**The problem:**
I will successfully go through method 1 when I display the PageA and method 2 when posting PageA, HOWEVER, I always seem to enter method 2 of the second action after processing of action1::method1  is complete.  I never go into action2::method 1 as desired.

Because I can dispatch to the appropriate methods in Action 1 at the correct state, I know the dispatching is working fine.

It appears however as if the state of action 1 when asked to process method 2 is held when being linked over to Action 2.  Action 2 never goes through the method for setting up the second page(method 1).  It always goes to method  2 of Action 2.


Can someone out there tell me what I have done incorrectly??


Muchly appreciated,

Justin




---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org