I found this answer very usefull but I can't figure out why it works.
In accordance with API pageContext getRequest() method returns ServletRequest and it doesn't contain getUserPrincipal() method. So why do things like this work
<c:if test="${not empty pageContext.request.userPrincipal}">
<c:if test="${pageContext.request.isUserInRole('ADMIN')}">
User ${pageContext.request.userPrincipal.name} in ADMIN Group
</c:if>
</c:if>
Is there implicit type conversion or what?