【发布时间】:2015-08-07 00:53:36
【问题描述】:
之后,从 1.5 升级到速度引擎 1.7 时出现了 1.5 不存在的问题。为了解释这个问题,我必须显示一个代码 sn-p:
#foreach($someVariable in $someCollection)
#foreach($anotherVariable in $someVariable.$anotherCollection)
$anotherVariable.someAttribute ## This expression print in the browser as is
## but if I do this way
$anotherVariable.get("someAttribute") ## works fine!
#end
#end
这发生在升级之后(在1.7),如果我回滚升级(移回1.5),那么我不必以我在上面代码中提到的其他方式sn- p.
【问题讨论】:
-
$anotherVariable的类型是什么? -
@EvanHaas 它是通用 ArrayList
-
ArrayList??那么 someAttribute 是什么?
-
@NathanBubna ArrayList 持有自定义类作为项目
-
java.util.ArrayList's get method 仅采用整数索引。这是您自己的
ArrayList自定义扩展吗?