欢迎访问悦橙教程(wld5.com),关注java教程。悦橙教程  java问答|  每日更新
页面导航 : > > 文章正文

Velocity 1.7 的一些新用法,velocity1.7用法,Velocity 是一个

来源: javaer 分享于  点击 37151 次 点评:85

Velocity 1.7 的一些新用法,velocity1.7用法,Velocity 是一个


Velocity 是一个非常不错的 Java 模板引擎,oschina 用的就是 velocity 模板引擎。

$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" )
相关栏目:

用户点评