我有一个例子
#set($organizationId = $layout.getGroup().getOrganizationId())
我可以将其重写为
#set($organizationId = $layout.group.organizationId)
它会完全一样吗?
答案 0 :(得分:2)
是。请参见此处:Velocity User Guide - Property Lookup Rules,其中说明:
例如,$customer.address
,序列为
getaddress()
getAddress()
get("address")
isAddress()
更准确地说,Velocity User Guide - Case Substitution:
$data.getRequest().getServerName()
## is the same as
$data.Request.ServerName