论坛首页 入门讨论版 Struts

Struts2标签比较字符串

浏览 128 次
该帖已经被评为新手帖
作者 正文
时间:2008-05-14
字符串比较,发现了两种写法
<s:set name="country_current" value="customervo.country" />
<s:if test="#country_current=='US'"><s:text name="%{getText('region.us')}"/></s:if>
或者:
<s:iftest="%{customervo.country=='US'}">
<s:textname="%{getText('region.us')}"/>
</s:if>

至于数字比较则比较简单:

<s:iftest="customervo.country==1">
<s:textname="%{getText('region.us')}"/>
</s:if>
   
论坛首页 入门讨论版 Struts

跳转论坛:
JavaEye推荐