The rendered
attribute (and disabled
and readonly
) does not necessarily expect a getter method which returns boolean
like this:
public boolean getBooleanValue() {
return this.booleanValue;
}
Those attributes just expect a boolean expression, which can be any of the following examples:
<h:someComponent rendered="#{myBean.booleanValue}" />
<h:someComponent rendered="#{myBean.intValue > 10}" />
<h:someComponent rendered="#{myBean.objectValue == null}" />
<h:someComponent rendered="#{myBean.stringValue != 'someValue'}" />
<h:someComponent rendered="#{!empty myBean.collectionValue}" />
<h:someComponent rendered="#{!myBean.booleanValue && myBean.intValue != 0}" />
<h:someComponent rendered="#{myBean.stringValue == 'oneValue' || myBean.stringValue == 'anotherValue'}" />
The is
prefix is by the way also allowed for boolean
getters:
public boolean isBooleanValue() {
return this.booleanValue;
}
You can wrap whatever API the Spring Security is using in the getter and make use of it in a boolean EL expression in one of the aforementioned ways.