Alireza Fattahi Alireza Fattahi - 1 month ago 5
Java Question

Using 'top' object in Struts 2.5

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


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


We used the top object in lots of JSP pages as below (which shows a list of
currencyTypes
and look up the name from struts messages):

<s:select name = "selectedCurrencyType"
list = "currencyTypes"
listKey = "top"
listValue = "%{getText('acc.currencyType.'+top)}" />


It currently works with struts
2.3.24.1
but according to above comment, will above select box works for
2.5
, or we will not have the top reference any more?!

If this is true, please let me know how should we fix above select?!

Answer

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.