Uploaded image for project: 'MyFaces Core'
  1. MyFaces Core
  2. MYFACES-2753

Trivial multi-level templating does not work if ui:include is used

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0.2-SNAPSHOT
    • 2.0.2
    • JSR-314
    • None
    • myfaces core trunk (2.0.2-SNAPSHOT), tomcat 6.0.26

    Description

      Following example does not produce any output:

      OuterClient.xhtml
      <ui:decorate
      template="/templates/OuterTemplate.xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets">
      <ui:define name="content">
      <ui:include src="InnerClient.xhtml" />
      </ui:define>
      </ui:decorate>

      OuterTemplate.xhtml:
      <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
      "http://www.w3.org/TR/html4/loose.dtd">
      <html
      xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:h="http://java.sun.com/jsf/html">
      <f:view>
      <h:head>
      <title>title</title>
      </h:head>
      <h:body>
      <ui:insert name="content" />
      </h:body>
      </f:view>
      </html>

      InnerClient.xhtml:
      <ui:composition
      template="/templates/InnerTemplate.xhtml"
      xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets">
      <ui:define name="content">
      Do you see me?
      </ui:define>
      </ui:composition>

      InnerTemplate.xhtml:
      <f:subview
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:f="http://java.sun.com/jsf/core">
      <ui:insert name="content" />
      </f:subview>

      But if OutterClient.xhtml looks like:
      <ui:decorate
      template="/templates/OuterTemplate.xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets">
      <ui:define name="content">
      <ui:composition template="/templates/InnerTemplate.xhtml">
      <ui:define name="content">
      Do you see me?
      </ui:define>
      </ui:composition>
      </ui:define>
      </ui:decorate>

      it outputs "Do you see me?" which is expected result in both cases. I think first case should work too - or am I missing something?

      Attachments

        1. MYFACES-2753-tests.patch
          27 kB
          Jakob Korherr
        2. MYFACES-2753-TestCase-FixIncludeUserTag.patch
          112 kB
          Leonardo Uribe
        3. MYFACES-2753-TestCase-FixInclude.patch
          72 kB
          Leonardo Uribe
        4. MYFACES-2753.tar.gz
          3 kB
          Martin Kočí
        5. MYFACES-2753.patch
          13 kB
          Jakob Korherr

        Issue Links

          Activity

            People

              jakobkorherr Jakob Korherr
              markoc50 Martin Kočí
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: