您的位置:首页 > 其它

Velocity模板引擎(template engine)学习笔记二

2010-12-16 17:20 537 查看
1.<input type="text" name="email" value="$email"/>

<input type="text" name="email" value="$!email"/>

解决前者初始化,email值为空,input框显示$email的情况

<input type="text" name="email" value="$!{email}"/>

解决前者初始化后,值仍为空的情况

2.

Jack is a $vicemaniac.

Jack is a ${vice}maniac.

Jack is a pyro

maniac.

Jack is a klepto
maniac

解决字符与变量一起时难于区分的情况

3.

$foo[0]       ## $foo takes in an Integer look up

$foo[$i]      ## Using another reference as the index

$foo["bar"]   ## Passing a string where $foo may be a Map

4.

$ 是取值

#是动作

##是注释

5.

标识符范围
alphabetic (a .. z, A .. Z)numeric (0 .. 9)hyphen ("-")underscore ("_")

                                            
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: