JSP页面判断后端字段的返回值为null时,需要转换空字符串。
可以用sql语句,nvl 关键字判断,但是苦于hibernate框架不熟,只好前端操作。
得到的效果如下:
<td>
<c:if test="${empty item.msgType}"></c:if>
<c:if test="${not empty item.msgType}">
[<span id="msgType" value="${item.msgType }" readonly="true" />]
</c:if>
</td>