我有下面的 Struts 2 标签,我需要检查属性是否value="#attr.row.Commentaire
不为空,如果不为空,则显示一个小图标,用户可以单击它并查阅属性的内容value="#attr.row.Commentaire
.
我怎样才能使用<s:if>
Struts 2 的标签能有效地做到这一点吗?
<display:column title="Commentaire" sortable="true" sortProperty="Commentaire"
class="alerte_td_commentaire">
<s:property value="#attr.row.Commentaire"/>
使用以下代码
<s:if test="#attr.row.Commentaire != null && #attr.row.Commentaire != ''">
The if tag使用test
要评估的属性OGNL表达式为布尔值。
您可能还想使用a tag它呈现一个 HTML 锚标记,可以与if
tag to
查阅财产内容
还有一个debug
标签可用于包装其他标签以向您显示将呈现调试数据的链接。
<s:debug>
<s:property value="%{#attr.row.Commentaire}"/>
</s:debug>
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)