• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Advantages of using LookupDispatchAction

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 228
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Be reasonable. You can't destroy everything. Where would you sit? How would you read a tiny ad?
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic