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 scope of the controller could be extended to the life of the application. Like in Spring framework the controller is put to the default scope by default, the default scope in Spring is singleton.
Struts2 has also a default scope, and it's also singleton. I want to put my action classes to this scope and remove them from the value stack.
How could I modify Struts2 framework to make my actions like a controller in Spring? I know that I could just delegate management of action classes to Spring, but I can't use a default scope, and Struts2 container is still keep running. I can't remove it from the framework, because it's not pluggable.
So, piggybacking around Spring and Struts2 container I can't make my action classes singletons because Struts2 instantiate them and put to the value stack. That is my question: if I choose the container between Struts and Spring to put my action classes to default scope, how could I tell Struts2 framework not to put them to the value stack?