Jsp 使用Struts2检查集合是否为空
我想在jsp页面中执行以下操作Jsp 使用Struts2检查集合是否为空,jsp,struts2,Jsp,Struts2,我想在jsp页面中执行以下操作 <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
<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"/> <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"/></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"/> <s:property value="comune"/> (<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>
()
()
如何使用Struts2 if语句检查熟悉列表是否为空?要检查列表是否为空,可以执行以下操作:
<s:if test="%{getFamiliari().isEmpty()}">
...
</s:if>
...
要检查列表是否为空,可以执行以下操作:
<s:if test="%{getFamiliari().isEmpty()}">
...
</s:if>
...