• 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

Action and DispatchAction

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

Can you tell me the Difference between Action and DispatchAction, DispatchAction and LookupDispatchAction

In DispatchAction we can perform CRUD operations in single Action. But Action we need to write seperate action for each operation. We can perform CRUD operations in Action through passing querystring. Then what else is the difference.

In LookupDispatchAction we need use getKeyMap method. What is the actual usage of that method. What is the exact difference between DispatchAction and LookupDispatchAction.

Thank You
 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
action classes are basically the controller in the MVC.

They will delegate to the respective action class which will render the JSP or the action class which will handle the request action.

The LookUp dispatch action is more suited for the event based actions. Basically if you have buttons on your screen, it can do the conditional navigation based on the action performed.
 
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

action classes are basically the controller in the MVC.



Action classes are not controllers. ActionServlets make that part of MVC for struts.

And in response to the OP's question, Basically you can do all the things in Actions which you do using DispatchActions. But while using Actions, you yourself need to pass the proper parameters from ActionMapping whereas if you use DispatchAction, struts does the bookkeeping for you.
 
This is my favorite tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic