Using 'top' object in Struts 2.5

跟風遠走 提交于 2019-12-02 06:31:01

Support for top object was added to support internal operations, it shouldn't be used by users (yes, expressing that in docs was a bad idea :( )

Anyway, looks like we must prepare a migration path or keep support for the top object.

Roman C

What I found in this documentation and what I use in my example Passing parameters to action through ModelDriven in Struts 2 the top object is a element of the CompaundRoot. And this class has a cutStack() method that is mentioned in

With expression like [0] ... [3] etc. Struts 2 will cut the stack and still return back a CompoundRoot object. To get the top of that particular stack cut, use 0.top.

The last expression is a typo for [xxx].top where xxx is the index of the CompoundRoot object. And this object could be referenced as [xxx]. It is a top object cut to the xxx index.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!