This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Struts and the fly likes generic code in action Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "generic code in action" Watch "generic code in action" New topic
Author

generic code in action

mark smith
Ranch Hand

Joined: Apr 05, 2005
Posts: 246
hi

i have two class who extends DispatchAction

theses two class use the same form class

theses two class have the same action, majority of the code of this theses actions are similar

example



is there a way to use these similar code for my two class who extends DispatchAction?

thanks
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

This seems pretty non-Struts specific.

There are at least a couple of options:

- Create a base class with a call-out to the class-specific part
- Create a sub class that calls a non-class-specific method
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: generic code in action
 
Similar Threads
Common base class for classes extending Action and DispatchAction Classes
Difference Between DispatchAction and Action (Not the usual question)
How to have Common base class for classes extending Action and DispatchAction Classe
Override DispatchAction but keep the existing funcationallity
Dyna Action Vs Dispatch Action