Hello,
I have the following xhtml facelets pages:
menu.xhtml
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:a4j="http://richfaces.org/a4j"
xmlns:pretty="http://ocpsoft.com/prettyfaces"
xmlns:c="http://java.sun.com/jsp/jstl/core">
<ul>
<!-- accueil -->
<c:choose>
<c:when test="#{page==accueil}">
<li id="active"><a href="#" id="current"><h:outputText value="#{msg['menu.accueil']}" /></a></li>
</c:when>
<c:otherwise>
<li><pretty:link id="accueil" mappingId="rootAction"><f:param value="#{view.locale.language}"/><h:outputText value="#{msg['menu.accueil']}" /></pretty:link></li>
</c:otherwise>
</c:choose>
<!-- galerie -->
<c:choose>
<c:when test="#{page==galerie}">
<li id="active"><a href="#" id="current"><h:outputText value="#{msg['menu.galerie']}" /></a></li>
</c:when>
<c:otherwise>
<li><pretty:link id="galerie" mappingId="galerieAction"><f:param value="#{view.locale.language}"/><h:outputText value="#{msg['menu.galerie']}" /></pretty:link></li>
</c:otherwise>
</c:choose>
<!-- biographie -->
<c:choose>
<c:when test="#{page==biographie}">
<li id="active"><a id="current" href="#"><h:outputText value="#{msg['menu.biographie']}" /></a></li>
</c:when>
<c:otherwise>
<li><pretty:link id="biographie" mappingId="biographieAction"><f:param value="#{view.locale.language}"/><h:outputText value="#{msg['menu.biographie']}" /></pretty:link></li>
</c:otherwise>
</c:choose>
<!-- commandes personnalisées -->
<c:choose>
<c:when test="#{page==commandesPersonnalisees}">
<li id="active"><a id="current" href="#"><h:outputText value="#{msg['menu.commandes-personnalisees']}" /></a></li>
</c:when>
<c:otherwise>
<li><pretty:link id="commandes-personnalisees" mappingId="commandesPersonnaliseesAction"><f:param value="#{view.locale.language}"/><h:outputText value="#{msg['menu.commandes-personnalisees']}" /></pretty:link></li>
</c:otherwise>
</c:choose>
<!-- contact -->
<c:choose>
<c:when test="#{page==contact}">
<li id="active"><a href="#" id="current"><h:outputText value="#{msg['menu.contact']}" /></a></li>
</c:when>
<c:otherwise>
<li><pretty:link id="contact" mappingId="contactAction"><f:param value="#{view.locale.language}"/><h:outputText value="#{msg['menu.contact']}" /></pretty:link></li>
</c:otherwise>
</c:choose>
<!-- liens -->
<c:choose>
<c:when test="#{page==liens}">
<li id="active"><a href="#" id="current"><h:outputText value="#{msg['menu.liens']}" /></a></li>
</c:when>
<c:otherwise>
<li><pretty:link id="liens" mappingId="liensAction"><f:param value="#{view.locale.language}"/><h:outputText value="#{msg['menu.liens']}" /></pretty:link></li>
</c:otherwise>
</c:choose>
</ul>
</ui:composition>
and in my home page:
<ui:include src="WEB-INF/include/menu.xhtml">
<ui:param name="page" value="accueil"/>
</ui:include>
The unexpected result is as follows: both the contents of <c:when... and <c:otherwise are displayed!!!
Can anyone please help?
Thanks in advance,
J.
Edited by: balteo on Dec 8, 2010 8:49 AM