例如
<c:if test="${post}">
<h3>${post.title}</h3>
</c:if>
Run Code Online (Sandbox Code Playgroud)
kro*_*old 106
使用empty关键字
<c:if test="${not empty post}">
<h3>${post.title}</h3>
</c:if>
Run Code Online (Sandbox Code Playgroud)
hej*_*007 11
你也可以用'!' 而不是'不':
<c:if test="${!empty post}">
<h3>${post.title}</h3>
</c:if>
Run Code Online (Sandbox Code Playgroud)