Display element in JSP only if model element not null
(P) Codever is an open source bookmarks and snippets manager for developers & co. See our How To guides to help you get started. Public bookmarks repos on Github ⭐🙏
How to display element in JSP only if model element not null
To do that you can use the
<div>
<c:if test="${not empty podcast.twitterPage}">
<a href="${podcast.twitterPage}" target="_blank" class="icon-twitter-producer producer-social"></a>
</c:if>
<c:if test="${not empty podcast.fbPage}">
<a href="${podcast.fbPage}" target="_blank" class="icon-facebook-producer producer-social"></a>
</c:if>
<c:if test="${not empty podcast.gplusPage}">
<a href="${podcast.gplusPage}" target="_blank" class="icon-google-plus-producer producer-social"></a>
</c:if>
</div>