Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Advantages of using LookupDispatchAction

 
Sam Kaye
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
What are the advantages of using LookupDispatchAction?
The requirement is this:
There are a bunch of links on the page. All of them really have the same Action. However, the processing has to be slightly different depending on the link clicked.
One way to achieve this is by setting a hidden form field for each of the links. The other is to use org.apache.actions.LookupDispatchAction. Which is the preferred way?
-SK
 
sandy gupta
Ranch Hand
Posts: 228
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You should use the hidden variable with a simple action command. LookUpDispatch action should be used to implement different functionality areas of a module e.g. add data, edit data, delete data, look up data for a user can be done in user action by extending lookupdispatch action and passing different paramter names.
For a case like yours where there are subtle differences in the logic based on a parameter, there is no need to use lookupdispatch action and cause repetitive code blocks in all the methods.
Besides, lookup dispatch action makes urls really ugly if you are using method names in the url(this is a personal opinion)
Thanks
Sahil
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic