开发者

Use Struts if Statement inside iterator

开发者 https://www.devze.com 2023-03-05 02:20 出处:网络
I really need your help开发者_如何学Python. I have the following Struts2 iterator? <s:iterator value=\"familiari\" status=\"entry\">

I really need your help开发者_如何学Python. I have the following Struts2 iterator?

<s:iterator value="familiari" status="entry"> 
</s:iterator>

How can I test the addess propery is empty??

the following does not work

<s:if test="#entry.addess!=''">
</s:if>


It seems you are misundestanding the meaning of the status propery of the iterator tag: that's an special iterator object to track row number (odd/even checks, etc).

You should use the var property. For example (not tested) :

<s:iterator  value="familiari" var="myobj"> 
   <s:if test="#myobj.addess != ''">
   </s:if>
<s:iterator>
0

精彩评论

暂无评论...
验证码 换一张
取 消