File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes Advantages of using LookupDispatchAction Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Advantages of using LookupDispatchAction" Watch "Advantages of using LookupDispatchAction" New topic

Advantages of using LookupDispatchAction

Sam Kaye

Joined: Nov 12, 2003
Posts: 6
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?
sandy gupta
Ranch Hand

Joined: Jan 30, 2001
Posts: 228
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)

I agree. Here's the link:
subject: Advantages of using LookupDispatchAction
It's not a secret anymore!