在struts2中,jsp页面里使用
<s:if test="${aaa == null}"></s:if>
会报错误:According to TLD or attribute directive in tag file, attribute value does not accept any expressions。
正确是使用方法:
<s:if test="%{aaa == null}">
<td width="7%" nowrap>${aaa}</td>
</s:if>
<s:else>
<td width="7%" nowrap>${bbb}</td>
</s:else>
本文介绍在Struts2框架中如何正确使用SIF标签进行条件判断。当试图在JSP页面上使用表达式进行条件判断时,若语法不当会导致错误。文章给出了正确的SIF标签使用示例。
1339

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



