I am using JSF2 on Facelets.
I define an <ui:param>
in a page:
<ui:composition template="/WEB-INF/templates/ui.xhtml"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:ui="http://java.sun.com/jsf/facelets"
>
<ui:param name="title" value="OnAir WebDemo" />
...
</ui:composition>
in the ui.xhtml
template I have:
<html
xmlns="http://www.w3.org/1999/xhtml"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:c="http://java.sun.com/jstl/core"
>
<c:if test="#{not empty title}">
<h1>#{title}</h1>
</c:if>
</html>
However, <c:if test>
seems to always evaluate true
, also if the <ui:param>
is not specified. How can I change the code so that <c:if test>
will actually evaluate false
when the <ui:param>
is not specified?
h:panelGroup
just for itsrendered
attribute for years; I didn't know aboutui:fragment
! This substantially improves performance and reduces the amount of generated HTML in places where I conditionally render things inui:repeat
s over large collections. Thanks! I learn something new with every one of your answers, @BalusC. – Indecent