Linking DispatchActions
Return Receipt Your Linking DispatchActions document: wasDennis Graham/EvergreenFunds received by: at:02/18/2005 12:35:52 PM - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Linking DispatchActions
Return Receipt Your Linking DispatchActions document: wasDennis Graham/EvergreenFunds received by: at:02/18/2005 12:35:51 PM - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Linking DispatchActions
Hi Guillermo, You should be able to add ?method=method2 to your path statement (. We use something very similar for the input tag. The only thing we do differently is that we use a different parameter name. Whereas our base action mappings use dispatchAction as the parameter, we use "validationFailure" as the parameter. If you use a different parameter, you would just need to replicate the ActionB mapping. Nick |-+> | | "Guillermo Meyer"| | | <[EMAIL PROTECTED]| | | ing.com.ar> | | || | | 05/17/2004 09:00 | | | AM | | | Please respond to| | | "Struts Users| | | Mailing List"| | || |-+> >--| | | | To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]> | | cc: | | Subject: Linking DispatchActions | >--| Hi: I have 2 Action classes (ActionA, ActionB) that extends DispatchAction class. Each Action has 3 methods: method1, method2 and method3. This is the executing scenario: 1) a post is made to ActionA.do with parameter set to "method3". 2) DispatchAction execute method3 according to parameter value (a request.getParameter()) 3) ActionA.method3() returns a forward that is declared as follows: This forward must execute ActionB.method2() when being executed from the previous forward. But as ActionB is also a DispatchAction, method3() will be executed instead of the method I want (method2) because request.getParameter() from mapping parameter is still method3 and request parameters cannot be changed during request lifetime. Possible solution: add a ?method=method2 to the forward path and set redirect="true" But i wouldn't like to perform a redirect. I could overrite DispatchAction.dispatchMethod to "rectify" method name according to some request attribute, but is there any other way to do it? Thanks in advance. Guillermo Meyer System Engineer EDS Argentina - Proyecto X71 Interbanking. 54.11.4322-1307 NOTA DE CONFIDENCIALIDAD Este mensaje (y sus anexos) es confidencial, esta dirigido exclusivamente a las personas direccionadas en el mail y puede contener informacion (i)de propiedad exclusiva de Interbanking S.A. o (ii) amparada por el secreto profesional. Cualquier opinion en el contenido, es exclusiva de su autor y no representa necesariamente la opinion de Interbanking S.A. El acceso no autorizado, uso, reproduccion, o divulgacion esta prohibido. Interbanking S.A no asumira responsabilidad ni obligacion legal alguna por cualquier informacion incorrecta o alterada contenida en este mensaje. Si usted ha recibido este mensaje por error, le rogamos tenga la amabilidad de destruirlo inmediatamente junto con todas las copias del mismo, notificando al remitente. No debera utilizar, revelar, distribuir, imprimir o copiar este mensaje ni ninguna de sus partes si usted no es el destinatario. Muchas gracias. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Linking DispatchActions
Hi: I have 2 Action classes (ActionA, ActionB) that extends DispatchAction class. Each Action has 3 methods: method1, method2 and method3. This is the executing scenario: 1) a post is made to ActionA.do with parameter set to "method3". 2) DispatchAction execute method3 according to parameter value (a request.getParameter()) 3) ActionA.method3() returns a forward that is declared as follows: This forward must execute ActionB.method2() when being executed from the previous forward. But as ActionB is also a DispatchAction, method3() will be executed instead of the method I want (method2) because request.getParameter() from mapping parameter is still method3 and request parameters cannot be changed during request lifetime. Possible solution: add a ?method=method2 to the forward path and set redirect="true" But i wouldn't like to perform a redirect. I could overrite DispatchAction.dispatchMethod to "rectify" method name according to some request attribute, but is there any other way to do it? Thanks in advance. Guillermo Meyer System Engineer EDS Argentina - Proyecto X71 Interbanking. 54.11.4322-1307 NOTA DE CONFIDENCIALIDAD Este mensaje (y sus anexos) es confidencial, esta dirigido exclusivamente a las personas direccionadas en el mail y puede contener informacion (i)de propiedad exclusiva de Interbanking S.A. o (ii) amparada por el secreto profesional. Cualquier opinion en el contenido, es exclusiva de su autor y no representa necesariamente la opinion de Interbanking S.A. El acceso no autorizado, uso, reproduccion, o divulgacion esta prohibido. Interbanking S.A no asumira responsabilidad ni obligacion legal alguna por cualquier informacion incorrecta o alterada contenida en este mensaje. Si usted ha recibido este mensaje por error, le rogamos tenga la amabilidad de destruirlo inmediatamente junto con todas las copias del mismo, notificando al remitente. No debera utilizar, revelar, distribuir, imprimir o copiar este mensaje ni ninguna de sus partes si usted no es el destinatario. Muchas gracias. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]