Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Execute() in DispatchAction

 
Pavan Kumar Tiruvaipati
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Hi,

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
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the method name you will specify in your parameter property of the action tag. that method will get triggered.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
nish projects
Greenhorn
Posts: 5
Java Oracle Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic