Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.1.17
    • Fix Version/s: 2.1.21
    • Component/s: facelets
    • Labels:
      None
    • Environment:

      Netbeans 7.3 RC, Glassfish 3.1.2.2

      Description

      This issue is easy to reproduce, we need 3 pages:

      First our template (template.xhmtl):

      <!DOCTYPE html >
      <html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html">
      <h:head>
      <title>Test</title>
      </h:head>

      <h:body>
      <h:panelGroup id="content" layout="block">
      <ui:insert name="content">#CONTENT#</ui:insert>
      </h:panelGroup>

      <ui:include src="/footer.xhtml" />
      </h:body>
      </html>

      our page (index.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="http://primefaces.org/ui"
      template="/template.xhtml">

      <ui:param name="reportBean" value="#

      {testBean}

      " />

      <ui:define name="content">
      <ui:include src="/WEB-INF/include/report-parameters.xhtml" />

      <h:form>
      <p:commandButton value="ERROR AJAX" action="#

      {testBean.error}

      " />
      </h:form>
      </ui:define>
      </ui:composition>

      and footer.xhtml to be included.

      When I load index.xhtml always is rendered with transitional doctype, I need specify the doctype in the index.xhtml page to render it correctly, I have noticed this is happening when I use ui:include (src with html code only), if I comment this line the doctype is changed, no obeying the doctype in template.xhtml.

        Activity

        Hide
        Lynx6 added a comment - - edited

        This problem arose because to http://code.google.com/p/omnifaces/issues/detail?id=134, the doctype problem maybe is related but not the same.

        Show
        Lynx6 added a comment - - edited This problem arose because to http://code.google.com/p/omnifaces/issues/detail?id=134 , the doctype problem maybe is related but not the same.
        Hide
        Ed Burns added a comment -

        Thanks for submitting the simple example, can you please make sure primefaces is not in the mix? If you take Primefaces out, does it still exhibit the undesirable behavior?

        Show
        Ed Burns added a comment - Thanks for submitting the simple example, can you please make sure primefaces is not in the mix? If you take Primefaces out, does it still exhibit the undesirable behavior?
        Hide
        Lynx6 added a comment -

        Hello Ed, I tested wihtout PF but when I use include the doctype is changed to transitional. My test is simple I type the url (index.xhtml only) in the browser to send a get request (not using the commandbutton to send a post), with firebug I check the doctype, when I comment the ui:include in template.xhmtl then index.xhtml in rendered correctly. Is strange, I can't to find where is the problem in the source files.

        Show
        Lynx6 added a comment - Hello Ed, I tested wihtout PF but when I use include the doctype is changed to transitional. My test is simple I type the url (index.xhtml only) in the browser to send a get request (not using the commandbutton to send a post), with firebug I check the doctype, when I comment the ui:include in template.xhmtl then index.xhtml in rendered correctly. Is strange, I can't to find where is the problem in the source files.
        Hide
        Lynx6 added a comment -

        I guess I can clarify this issue, the problem is when I use ui:include, check this code to footer.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">
        <div id="footer">
        <!------- ELEMENTS (HTML OR JSF TAGS)--------->
        </div>
        </ui:composition>

        if I change that code for this one:

        <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">
        <h:panelGroup id="footer" layout="block">
        <!------- ELEMENTS (HTML OR JSF TAGS)--------->
        </h:panelGroup>
        </ui:composition>

        the problem is resolved, the first tag can´t be pure HTML.

        is necessary check when the wrapper is HTML tag, for example:

        <div>
        <ui:include src="/footer.xhtml" />
        </div>

        I'm having problems with javax.faces.FACELETS_SKIP_COMMENTS=true, but is resolved when I use JSF tags.

        Show
        Lynx6 added a comment - I guess I can clarify this issue, the problem is when I use ui:include, check this code to footer.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"> <div id="footer"> <!------- ELEMENTS (HTML OR JSF TAGS)---------> </div> </ui:composition> if I change that code for this one: <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"> <h:panelGroup id="footer" layout="block"> <!------- ELEMENTS (HTML OR JSF TAGS)---------> </h:panelGroup> </ui:composition> the problem is resolved, the first tag can´t be pure HTML. is necessary check when the wrapper is HTML tag, for example: <div> <ui:include src="/footer.xhtml" /> </div> I'm having problems with javax.faces.FACELETS_SKIP_COMMENTS=true, but is resolved when I use JSF tags.
        Hide
        Manfred Riem added a comment -

        Am I to understand the issue has been solved?

        Show
        Manfred Riem added a comment - Am I to understand the issue has been solved?
        Hide
        Lynx6 added a comment -

        this problem persist when I use pure HTML (div tag instead of h:panelGroup) with ui:include. if this is working as designed then in the docs is not specified.

        Show
        Lynx6 added a comment - this problem persist when I use pure HTML (div tag instead of h:panelGroup) with ui:include. if this is working as designed then in the docs is not specified.
        Hide
        Manfred Riem added a comment -

        Can you check this against 2.1.21?

        Show
        Manfred Riem added a comment - Can you check this against 2.1.21?
        Hide
        Lynx6 added a comment -

        I forgot about this... I can't reproduce it, apparently is fixed.

        Show
        Lynx6 added a comment - I forgot about this... I can't reproduce it, apparently is fixed.
        Hide
        Manfred Riem added a comment -

        As per reporter.

        Show
        Manfred Riem added a comment - As per reporter.

          People

          • Assignee:
            Manfred Riem
            Reporter:
            Lynx6
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: