Using 'top' object in Struts 2.5

前端 未结 2 1658
天涯浪人
天涯浪人 2021-01-23 14:47

According to http://struts.apache.org/docs/s2-026.html :

Support for expression using top will be dropped in upcoming Struts version 2.5!

2条回答
  •  礼貌的吻别
    2021-01-23 15:07

    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.

提交回复
热议问题