• 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

Dispatch Action

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
can we write execute method in the action class extended from DispatchAction
OR LookUpDispatchAction.
if(yes)
{
why?
}
else
why?


please reply?
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, you can write an execute method for a DispatchAction, but would you really want to?

Think about it: The logic to dispatch to another method is in the execute method of the DispatchAction superclass. If you override that method, you could disable the dispatching ability.

One possible reason you might want to override it would be if there is some common logic you want to perform before dispatching to the various methods. In that case you could perform your logic and then call super.execute() to dispatch to the other methods.
[ July 28, 2006: Message edited by: Merrill Higginson ]
 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Say i am having a common operation of populating a record from database,(for eg)for update and view operation i need to populate values from the database. in that case i require to perform a common operation in one method and transfer control automatically to another method. I need to perform this operation only once just like init() method of servlet.Could anybody please help me
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic