开发者

Check if collection is empty using Struts2

开发者 https://www.devze.com 2023-03-01 21:04 出处:网络
I want to do the following interation inside a jsp page <s:iterator value=\"familiari\" status=\"entry\">

I want to do the following interation inside a jsp page

    <s:iterator value="familiari" status="entry">
        <div id="familiare'<s:property value="#entry.index" />'" style="margin:1% 1%; float:left; width: 48%;">
            <h3><a href="#"><s:property value="nome"/>&nbsp;<s:property value="cognome"/></a></h3>
            <div style="padding:5px;">
                <label><s:text name="detraz.cf"/></label> <s:property value="codiceFiscale"/>
                <label><s:text name="detraz.relParent"/></label> <s:property value="descRelParentale"/>
                <br />
                <br />
                <label><s:text name="detraz.dataNascita"/></label> <s:property value="dataNascita"/><br />
                <label><s:text name="detraz.comuneNascita"/>&l开发者_开发知识库t;/label> <s:property value="comuneNascita"/><br />
                <label><s:text name="detraz.provNascita"/></label> (<s:property value="provinciaNascita"/>)<br />
                <br />
                <label><s:text name="detraz.indResidenza"/></label><br />
                <s:property value="indirizzo"/><br />
                <s:property value="cap"/>&nbsp;<s:property value="comune"/>&nbsp;(<s:property value="provincia"/>)<br />
                <s:property value="stato"/>
                <s:url id="ajaxModifyAction" value="detraz_getDettagliFamilare"/>
                <button id="modifica-<s:property value="#entry.index" />" style="float:right;"><s:text name="button.modifica"></s:text></button>            
            </div>
        </div>          
    </s:iterator>

How would I check if the familiari List is empty using Struts2 If statements?


To check to see whether or not your list is empty, you can do something like:

<s:if test="%{getFamiliari().isEmpty()}">
...
</s:if>
0

精彩评论

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