I have a subclass of DispatchAction to dispatch various actions to corrosponding methods
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Anonymous
Posted On:   Monday, March 3, 2003 12:11 PM

in the same action class from multiple submit button on JSP Page. I have created subclass ( public class OperatorDispatchAction extends DispatchAction ) of DispatchAction and my struts-config.xml is configured properly with parameter="method" option for this action. On the jsp page, I have proper actions="xxxdispatch.do" for form's actin attribute. My buttons look like this: I also have proper method in Action class(OperatorDispatchAction), "save" and "update" and default method "execute". Now, when I run my jsp page and click on either update or save button, it always calls execute methods and retuns out from it as I have return mapp   More>>

in the same action class from multiple submit button on JSP Page.

I have created subclass ( public class OperatorDispatchAction extends DispatchAction ) of DispatchAction and my struts-config.xml is configured properly with parameter="method" option for this action. On the jsp page, I have proper actions="xxxdispatch.do" for form's actin attribute.
My buttons look like this:




I also have proper method in Action class(OperatorDispatchAction), "save" and "update" and default method "execute". Now, when I run my jsp page and click on either update or save button, it always calls execute methods and retuns out from it as I have return mapping.findforward("success") statement at the end, without ever calling my save or update method, which I expect when I click on corrosponding button.

I suspect that buttons' attributes need to have extra information or do i have to modified default execute method so that it can delegates control to save or update method.

Please help.

   <<Less

Re: I have a subclass of DispatchAction to dispatch various actions to corrosponding methods

Posted By:   AlessandroA_Garbagnati  
Posted On:   Monday, March 3, 2003 12:38 PM

Hi,

If you specify that the parameter that contains the action is called "method", than that is the property you have to set with save or update, that means the action you want to execute.
About | Sitemap | Contact