一个中可以有多个条件
test。
<c:if test="${salesData != null && fn:length(salesBundle.salesArea) > 0}"> <input type="text" id="sales_area" ></c:if>但是,您也可以使用
empty关键字 同时 执行nullcheck和lengthcheck。
<c:if test="${not empty salesData.salesArea}"> <input type="text" id="sales_area" ></c:if>现在,这是您所能获得的最好的。如果您需要在页面其他地方 重用 相同的条件,则也可以通过保存它
<c:set>。
<c:set var="hasSalesData" value="${not empty salesData.salesArea}" />...<c:if test="${hasSalesData}"> <input type="text" id="sales_area" ></c:if>...<c:if test="${hasSalesData}"> Foo</c:if>


