2012-10-08 28 views
0

中的條件我正在使用Spring Roo。有table:tabletable:column標籤。如果表標記

<table:table data="${memberDetails}" id="memberDetail" delete="false" 
       create="false" 
       update="false" show="false" paginationFlag="false" 
       path="" typeIdFieldName="instanceId" 
       z="40I0ZgJoR5iBRXkYGHvl959736E="> 
    <table:column id="customer" property="user.name"/> 
</table:table> 

如何把檢查null或空,如果財產user.name是不是空的?如果它是空的,我希望在那裏解決其他財產。

+0

嘗試'$ {不是空user.name? user.name:'Bob'}' – Florent

+0

Florent非常感謝您的回覆。我嘗試了你的建議,但那沒有奏效。 –

回答

0

檢查這個代碼

<c:if test="${user.name =='null'}" > 
<table:column id="customer" property="user.name"/> 
</c:if> 

或者你可以使用

<c:if test="${not empty user.name}"> 
     <table:column id="customer" property="user.name"/> 
    </c:if> 
+0

Sajith看來你沒有遇到什麼麻煩,我正面臨着。 實際上,'user.name'屬性是'memberDetails'列表或設置對象內的對象的子屬性(請參閱我的表標記的'數據'屬性) –

+0

然後你也可以檢查這個。 – Sajith