ITeye博客

OGNL的使用----控制标签

gu6866 · 2012-08-24 14:48 · Struts · JSTL&OGNL · 开源软件 · Markdown

使用Struts2标签必须先导入标签库,在页面使用如下代码导入Struts2标签:
<%@taglib prefix="s" uri="/struts-tags"%>

 

 

if/elseif/else标签:

 

<s:set name="age" value="29">
<s:if test="#age>60">
老年人
</s:if>
<s:elseif test="#age>35">
中年人
</s:elseif>
<s:elseif test="#age>15">
青年人
</s:elseif>
<s:else>
少年儿童
</s:else>

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。