Writing your own Action class that extends Action and then extending that to make each 
class is an option.  

Depending on the nature of your shared code, it might be easier to just make an 
"ActionHelpers" class that contains a bunch of methods, maybe a bunch of static 
methods even, depending on what the code your trying to share actually is.  

I've done this in the past because I had some common code at the start and finish of 
each Action that had to execute (and there was a reason this worked while extending 
some class didn't, but I don't frankly remember the reason now).

-- 
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com

On Thu, September 30, 2004 1:13 pm, Danilo Gurovich said:
> Why don't you just create an abstract action and extend it?
> 
> Danilo Gurovich
> Manager, Web Development
> LowerMyBills.com
> [EMAIL PROTECTED]
> 2401 Colorado Ave., 2nd Floor
> Santa Monica, CA 90404
> (310) 998-6412
> 
> 
> 
> 
> -----Original Message-----
> From: Ciaran Hanley [mailto:[EMAIL PROTECTED]
> Sent: Thursday, September 30, 2004 3:16 AM
> To: Struts User Mailing List
> Subject: Reusing methods across actions classes
> 
> Hey,
> 
> 
> 
> Bit of a dummy question here but I am wondering what is the best way to
> reuse methods across different action classes. Is it acceptable to make
> an
> instance of an action class within an action class so I can use one of
> its
> methods. Or would it be better to simply copy and paste the method into
> the
> both classes. Or should I extract all common methods into one class and
> create an instance of this class as required. Any suggestions?
> 
> 
> 
> CH
> 
> 
> ---------------------------------------------------------------------
> 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