velocity 数组方法
##*.vm页面
#set($types = ["doc", "docx", "pdf", "jpg", "png", "bmp"])
#if($types.indexOf("pdf") > -1) // 2
代码块
#end
##数组长度
$types.size() // 6
##判空
$types.isEmpty() // false
##取值
$types[0] // doc
$types.get(0) // doc
##遍历
#foreach($item in $list)
$foreach.first ## 开始元素
$foreach.last ## 结束元素
$foreach.hasNext ## 是否最后一次循环
$foreach.index ## 当前序号,从0开始
$foreach.count ## 当前序号,从1开始
$velocityCount ## 当前序号,从1开始
代码块
#break ##跳出循环 循环以外代码继续执行。
#stop ##直接终止输出,跳出循环,并且循环以外代码终止执行。
#end
velocity 其他问题
##*.vm页面
##页面jQuery冲突
<script type="text/javascript">
jQuery(function($){
$('#txt').val();
});
</script>
##关于#set在任何位置都会编译的问题,加条件可限制
#set($currentPage = "1")
#if(条件)
#set($currentPage = 2)
#end