How to remove actions from the value stack?

前端 未结 1 1702
情书的邮戳
情书的邮戳 2021-01-25 21:05

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

相关标签:
1条回答
  • 2021-01-25 21:46

    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.)

    0 讨论(0)
提交回复
热议问题