I\'m trying to make my action classes singletons. The point is to make action classes real controllers in MVC pattern. Especially when implementing REST controllers the
Assuming you're using XWork's DefaultActionInvocation
implementation, it's done there, by the init
method. Pulling that out is a bit of a pain because it's layered underneath action proxies and action proxy factories in both XWork and S2.
That said, I'd be very hesitant at making a change like this; it has system-wide implications and is counter to essentially everything about XW/WW/S2.
(Unrelated, but singleton nature isn't what defines a controller, it's the responsibilities that define what a component is.)