Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Use Struts if Statement inside iterator

I really need your help. 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>
like image 590
AngeloBad Avatar asked Feb 24 '23 06:02

AngeloBad


1 Answers

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>
like image 124
leonbloy Avatar answered Mar 05 '23 07:03

leonbloy