This is not right:
<c:when test="${empty cc.attrs.listener}">
The #{cc.attrs.listener}
is here evaluated as a ValueExpression
in order to satisfy the empty
check. Thus, the entire EL expression is executed as if it's a property and the (getter) method behind the EL is invoked and its result is returned to the empty
check.
You need to check it as follows instead:
<c:when test="#{cc.getValueExpression('listener') != null}">
This won't execute the EL expression, but just check if there's a ValueExpression
present without actually evaluating it.