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
It may also depend on what kind of code you are trying to reuse. If its
something that is action-related (populating a form, etc.) then I would
agree with Danilo's answer.
If on the other hand, the code is related to business logic that is
really independent of the struts portion, then I would
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
Thursday, September 30, 2004 6:25 AM
> To: 'Struts Users Mailing List'; [EMAIL PROTECTED]
> Subject: RE: Reusing methods across actions classes
>
>
> My actions already extend Action. Should I write a superclass that extends
> Action, and then extend this class, i
Probably you can create a Generic Action class which extends Struts Action
class and make all your Action classes extend this class. You can then put
the reusable methods in this class and it can be used by all your Action
classes.
-Prasenjit
-Original Message-
From: Ciaran Hanley [mailt
ts Users Mailing List'"
<[EMAIL PROTECTED]>,<[EMAIL PROTECTED]>
Subject: RE: Reusing methods across actions classes
Date: Thu, 30 Sep 2004 11:25:25 +0100
My actions already extend Action. Should I write a superclass that extends
Action, and then extend this class, is that correc
: Reusing methods across actions classes
I would say that if you have common functionality such as a method that all
objects [Actions] share then place the common method in a super class
[Action] that the other classes can extend.
Original Message Follows
From: "Ciaran Hanley&quo
I would say that if you have common functionality such as a method that all
objects [Actions] share then place the common method in a super class
[Action] that the other classes can extend.
Original Message Follows
From: "Ciaran Hanley" <[EMAIL PROTECTED]>
Reply-To: "Struts Users Mailing
8 matches
Mail list logo