I came across some .xhtml files where for some components the expression language used was like rendered="#{empty from}", rendered="#{empty create}" etc.
I know that empty is an operator in EL, used to check whether a value is null or empty, but I did not understand the meaning of above mentioned ELs.
Can somebody explain to me what above EL’s mean?
The
renderedattribute is a signal whether JSF should generate HTML for the component or not. If it evaluatesfalse, then it won’t generate HTML for the component (nor for its children). The#{empty form}will evaluatefalsewhen the#{form}is not null nor empty.Simple as that. You can find another examples of boolean expressions here: Conditionally displaying JSF components