How can i check if an attribute is set (not null and not an empty string) with jstl?

Viewed 69348

E.g.

<c:if test="${post}">
    <h3>${post.title}</h3>  
</c:if>
2 Answers

Use the empty keyword

<c:if test="${not empty post}">
   <h3>${post.title}</h3>   
</c:if>
Related