Accessing non-properties via jsp el
In the code below, I need to access a method that is not a property. I need a c:foreach variable to be visible to be the test as well. I'm dealing with someone else's code. I'm not particularly happy with the design of it, but that's easy when dealing with someone else's code.
I would prefer to just set the actual visible roles in the controller, but all of the data is read from a global cache in multiple places. The junk below represents the fewest lines of code to get desired behavior.
<c:forEach var="role" items="${resource.value.rs}">
//don't have access to role in scriptlet context
<c:if test="<% role.isVisible(session.getAttribute("authUser")) %>">
</c:if> </c:foreach>
A simple solution would be .. if I could do:
//can't call isVisible through el I don't believe
<c:if test="${role.isVisible(session.authUser)}">
but I am pretty sure you can't do that.
I'm in the process of rewriting to avoid scriptlets, but if anyone had a quick fix, I would entertain it.
Thanks.