Quickest way I found was to cut and paste the code from DispatchAction
source into my own class that extended my base class instead of action, then
I extend my DispatchActions from that. The disadvantage is that if you
upgrade to a new version of struts you need to remember to update your base
dispatch action class.

Nowdays though i prefer not to use dispatch actions, but rather hardcode an
if statement to check the parameter in my execute and branch on that. Its a
little more typing, but I find it gives more control and is more convienient
in other ways.

-----Original Message-----
From: Pat Quinn [mailto:[EMAIL PROTECTED]
Sent: Thursday, 18 September 2003 18:09
To: [EMAIL PROTECTED]
Subject: Re: Template Method Design


Take a look at Chapter 10 - Exception Handling in Programming Jakarta Struts
by chuck cavaness.. i think you'll find this very helpful.

I've implement this with Action but ill soon need to do the same for
Dispatch Action too... has anyone done likewise for Dispatch and other such
actions?



>From: "Vijay K Hegde" <[EMAIL PROTECTED]>
>Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
>To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
>Subject: Template Method Design
>Date: Thu, 18 Sep 2003 15:01:59 +0530
>
>Hi,
>
>   I have a requirement. Anybody has created an abstract action class that
>extends Action. It makes the perform method as final. And creates an
>abstract method satPerform that has to implemented by the classes extending
>thus providing sort of a base class.
>
>The intention behind is to take care of exception handling in the abstract
>class and rest in the child classes.
>
>Action ---->  perform()
>Abstract Class extends Action----> final perform(), abstract satPerform()
>SatAction extends Abstract -----> satPerform().
>
>The pattern is Template Method Design.
>
>If anybody has used such approach, please share the details.
>
>If somebody could shed some light in this topic i would be grateful.
>
>Vijay K. Hegde
>Software Engineer
>Infosys Technologies Limited, Hyderabad
>* (040) 2300 5222 extn 23239
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>

_________________________________________________________________
Add photos to your e-mail with MSN 8. Get 2 months FREE*.
http://join.msn.com/?page=features/featuredemail


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to