If I write execute() method in DispatchAction include other methods like add(),delete(),save()......, If I click add button in jsp, which method will invoke first? execute() or add()
Venkat Raman Parasuraman
Greenhorn
Joined: Oct 13, 2008
Posts: 10
posted
0
the method name you will specify in your parameter property of the action tag. that method will get triggered.
I don't recall specifically how DispatchAction works, but I'd expect if you implement your own execute() that it wouldn't work at all--DispatchAction has its own execute() method used to function normally.
Hi, if you define the execute method in the dispatchaction servlet, the execute will be called as from the requestprocessor, action.execute is being called. As the dispatchAction extend the Action class, it will call the execute method. If you see the DispatchAction class, it defines the execute method, in which internally it invokes the appropriate method of the user dispatchaction class. So if you define the execute method, it will not call the execute method of the base DispatchAction class, hence your method will not be called.