• 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

DispatchAction and child classes

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Struts Champs,

I have one question. What is the difference between DispatchAction , LookupDispatchAction and MappingDispatchAction ? When to use which class? LookupDispatchAction and MappingDispatchAction are child of DispatchAction but in practical life when to use what ?

Thanks in Advance for proper reply.

Nakul
 
Ranch Hand
Posts: 544
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
When you use the extend the DispatchAction you need to send a request parameter so that ActionServlet dispatches the request to appropriate method. So URL might look like




In case of MappingDispatchAction you can hide the real action from end user.Here in struts-config.xml you configure a action-mapping which has a attribute named "parameter" that maps to the method name. This way you create different URI mappings for different methods.
for e.g


The URI /products then mapped to action-mapping having parameter="displayProduct".

I have never used LookupDispatchAction,guess it works on the same lines. Only the method names comes from a ApplicationResources file.

Regards,
Amit

For more information you can take a look at the JavaDoc http://struts.apache.org/1.2.4/api/index.html

[ September 12, 2007: Message edited by: amit punekar ]
[ September 12, 2007: Message edited by: amit punekar ]
 
Surfs up space ponies, I'm making gravy without this lumpy, 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