File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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 Java Interview Guide this week in the Jobs Discussion 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: 251

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
I agree. Here's the link:
subject: generic code in action
It's not a secret anymore!