Velocity 是一个非常不错的 Java 模板引擎。
$velocityCount 的新用法
<table>
#foreach( $customer in $customerList )
<tr><td>$foreach.count</td><td>$customer.Name</td></tr>
#end
</table>
$velocityHasNext 的新用法
#foreach( $customer in $customerList )
$customer.Name#if( $foreach.hasNext ),#end
#end
退出foreach循环
## list first 5 customers only
#foreach( $customer in $customerList )
#if( $foreach.count > 5 )
#break
#end
$customer.Name
#end
同时引入多个文件
#include( "one.gif","two.txt","three.htm" )
原创文章,作者:Maggie-Hunter,如若转载,请注明出处:https://blog.ytso.com/tech/pnotes/10375.html