I have an action that loads a session variable. In my jsp, I want to modify the text depending on my session variable.
---- action --------------
HttpSession session = request.getSession();
if(/* Test for Admin */)){
debug("isAdmin = true"); // THIS LINE PRINTS, SO I know isAdmin is set.
boolean isAdmin = new Boolean(true);
session.setAttribute("isAd
min", isAdmin);
}
--------end action-------
---------jsp -------------
<%@ taglib uri="
http://java.sun.com/jsp/jstl/core" prefix="c" %>
...
Welcome
<c:choose>
<c:when test="${(sessionScope.isAd
min!=null)
}">
Administrator
</c:when>
</c:choose> <br>
------------------------
Page prints: "Welcome" not "Welcome Administrator"
What's the proper way to access my session variables.
Start Free Trial