File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes Interceptors vs. BaseActions Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Interceptors vs. BaseActions" Watch "Interceptors vs. BaseActions" New topic

Interceptors vs. BaseActions

Junilu Lacar

Joined: Feb 26, 2001
Posts: 6529

Been looking at the Struts Action Invocation Framework and was wondering if the Interceptors would make it unnecessary to have all your Actions extend a BaseAction. Haven't seen too many examples of how these things are used so if anybody has experiences/thoughts on this to share it would much appreciated.

Junilu - [How to Ask Questions] [How to Answer Questions]
Chris Mathews
Ranch Hand

Joined: Jul 18, 2001
Posts: 2712
No, I don't think so. You will still want to have BaseActions to provide common functionality to your Actions. However, Interceptors are useful for declaratively tacking on orthogonal services to your application easily. It is a poor man's AOP with a very limited pointcut selection. Therefore, I don't see Interceptors replacing BaseActions any more than I see AOP replacing Inheritance.
If you are interested in Interceptors then I suggest you checkout XWork/WebWork2... it is built into the framework and they did a much better job of it.
I agree. Here's the link:
subject: Interceptors vs. BaseActions
jQuery in Action, 3rd edition