Hi,
I saw some code like the following in a JSP
<c:if test="<%=request.isUserInRole(RoleEnum.USER.getCode())%>">
<li>user</li>
</c:if>
My confusion is over the "=" that appears in the value of the test
attribute. My understanding was that anything included within <%= %>
is printed to the output, but surely the value assigned to test must be a Boolean, so why does this work?
For bonus points, is there any way to change the attribute value above such that it does not use scriptlet code? Presumably, that means using EL instead.
Cheers, Don