wood burning stoves 2.0*
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 Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "generic code in action" Watch "generic code in action" New topic

generic code in action

mark smith
Ranch Hand

Joined: Apr 05, 2005
Posts: 246

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


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

David Newton

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
wood burning stoves
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