How can i check if an attribute is set (not null and not an empty string) with jstl?
JstlJstl Problem Overview
E.g.
<c:if test="${post}">
<h3>${post.title}</h3>
</c:if>
Jstl Solutions
Solution 1 - Jstl
Use the empty keyword
<c:if test="${not empty post}">
<h3>${post.title}</h3>
</c:if>
Solution 2 - Jstl
You can also use '!' instead 'not' :
<c:if test="${!empty post}">
<h3>${post.title}</h3>
</c:if>