Velocity之$velocityCount-1
Velocity中使用$velocityCount+1是没问题的,但$velocityCount-1会直接打出整个字符串。
如果用#set($i=$velocityCount-1),报错ParseErrorException.
原来Velocity中不能直接使用+-*/,因此改用#set($i=$math.sub($velocityCount,1)),搞定.
$math为org.apache.velocity.tools.generic.MathTool
如果用#set($i=$velocityCount-1),报错ParseErrorException.
原来Velocity中不能直接使用+-*/,因此改用#set($i=$math.sub($velocityCount,1)),搞定.
$math为org.apache.velocity.tools.generic.MathTool
声明:该文观点仅代表作者本人,牛骨文系教育信息发布平台,牛骨文仅提供信息存储空间服务。
