I have scriplet and jstl code that checks if a user's email is root
and if so, add a div to a header. The scriplet code works, while jstl code doesn't.
scriplet code:
<%
if (user.getEmail().equals("root")) {
%>
<div class="button logout-button"
onclick="location.href =
'${pageContext.request.contextPath}/initializedatabase'">
Initialize the database
</div>
<%
}
%>
jstl code:
<c:if test =
"${sessionScope.user != null} &&
${sessionScope.user.getEmail() == 'root'}">
<div class="button initialize-button"
onclick="location.href='${pageContext.request.contextPath}/initializeddatabase'">
Initialize Database
</div>
</c:if>