aspose file tools*
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
Author

Advantages of using LookupDispatchAction

Sam Kaye
Greenhorn

Joined: Nov 12, 2003
Posts: 6
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

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)
Thanks
Sahil


Adios
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Advantages of using LookupDispatchAction
 
Similar Threads
Action Form
How to do two actions on a same Form in Struts?
One forum, dynamic action on submit
position of the opening brace {
JSP 2.0 Expression Language