1、<ww:property>
|
attribute |
required |
deion |
|
id |
no |
唯一标识符 |
|
|
no |
内容 |
|
escape |
no |
Determines if the contents should be escaped appropriately for valid HTML characters |
例:
Action返回一个名为user的User类对象,User类中有username属性
<ww:property =”user.username”/>
2、<ww:if> <ww:else> <ww:elseif>
|
attribute |
required |
deion |
|
id |
no |
唯一标识符 |
|
test |
yes |
判断条件 |
例:
Action返回一个名为user的User类对象,User类中有age属性,如果年龄能被2整除,我们将它显示,否则显示“年龄不能被20整除”
<ww:if test="user.age%20==0">
<ww:property ="user.age"/>
</ww:if>
<ww:else>
年龄不能被20整除
</ww:else>
3、<ww:iterator>
|
attribute |
required |
deion |
|
id |
no |
唯一标识符 |
|
status |
no |
迭代的状态 getCount(), getIndex(), isFirst(), isLast(), isEven(), isOdd(). 通过以上方法能取得迭代的信息 |
|
|
no |
要输出的对象 |
例:
如果action返回一个名为list的List,里面存放User类的列表,User类中有一个username的属性:
<ww:iterator =”list”>
<ww:property =”username”/>
</ww:iterator>
如果要加序号,则:
<ww:iterator =”list” status=”li”>
<ww:property =”#li.count”/> <ww:property =”username”/>
</ww:iterator>
注意:用status时,要加‘#’
4626

被折叠的 条评论
为什么被折叠?



