Both statements may be one line after another but they are not executed at the same time. <c:if>
is a JSTL-Tag which is executed during view build time. The other expression will be wrapped in a <h:outputText>
which will be executed during view render time. And I guess the service will be created in between.
To solve your problem you could replace the <c:if>
with
<ui:fragment rendered="#{serviceUiDescriptions.isLinkInDescriptionForCheckbox(service)}">
or replace the <span>
element with
<h:panelGroup styleClass="smallText" rendered="#{serviceUiDescriptions.isLinkInDescriptionForCheckbox(service)}">
(without the <c:if>
).
See also: