I'm using facelets (JSF2.1) and I'm trying to do something like:
<c:forEach var="domainObject" items="#{MB.listOfDomainObjects}">
<sec:authorize access="hasPermission(#domainObject,'PERMISSION_X')">
hello world
</sec:authorize>
</c:forEach>
I've tried changing #domainObject
by @domainObject
, #{domainObject}
, $domainObject
and a lot of other combinations with the same result: domainObject
is not processed correctly. Sometimes I get an error saying the page cannot be constructed, others domainObject
is null.
It's like the scope where the tag c:forEach
puts the variable domainObject
is not scanned by sec:authorize
to find it.
I've tried also to force the use of a scope using the tag <c:set ... scope="view"/>
. I've also tried to use <ui:repeat>
with the same results, but considering the tag sec:authorize
is a jstl one, I suppose is executed in build time (like c:forEach
) and not in render time (like ui:repeat
), so I think I must use c:foreach
and not ui:repeat
.
Any chance to solve my problem?