Hello,

we have a question regarding the visibility of <ui:define> across included 
sites.

Our website has been initially build to run on Mojarra, but we wanted to try 
and switch to MyFaces due to different bugs in Mojarra 2.1.3.

We use a templating which makes use of <ui:include> and a custom tag library. I 
created a small example of how these includes look like.

index.xhtml :
###############
<ui:composition …
                template="/WEB-INF/includes/template.xhtml">

                <ui:define name="testDefine">
                               <h:outputText value="Output from testDefine" />
                </ui:define>

                <ui:define name="main">
                               <h:outputText value="Welcome to the HOME page." 
/>

                               <cu:test />

                </ui:define>

</ui:composition>
###############

Definition of <cu:test>:
###############
<ui:composition xmlns:ui="http://java.sun.com/jsf/facelets";>
                <ui:insert name=" testDefine ">testDefine not found!</ui:insert>
</ui:composition>
###############

The problem we are running into is, that the insert from our custom tag cannot 
find the <ui:define> defined in the parent page of the included tag. This used 
to work on Mojarra.
It seems that, on MyFaces, the visibility of <ui:define> is restricted to the 
current page. We are having the same problem with the <c:set> tag.

Our question is, who is right in this case, Mojarra or MyFaces? As far as we 
see, the JSF specification doesn’t provide any information on this.


Best regards,
Michael Hensel

Reply via email to