0

My <!DOCTYPE html> declaration is getting removed from my JSF pages, and it's messing things up.

This same question has been asked a bunch of times:

HTML doctype declaration in JSF

DocType is not showing in the rendered output from JSF

JSF template: rendered page missing DOCTYPE

Trouble is, this Jira entry says the bug has been fixed. Apparently not. I'm using the most recent version:

    <dependency>
        <groupId>com.sun.faces</groupId>
        <artifactId>jsf-impl</artifactId>
        <version>2.2.0-m07</version>
    </dependency>

    <dependency>
        <groupId>com.sun.faces</groupId>
        <artifactId>jsf-api</artifactId>
        <version>2.2.0-m07</version>
    </dependency>

For reference, here are my pages:

test_layout.xhtml:

<!DOCTYPE html>
<html xmlns:ui="http://java.sun.com/jsf/facelets">
<body>
    <ui:insert name="content"/>
</body>
</html>

test_content.xhtml:

<ui:composition 
    xmlns:ui="http://java.sun.com/jsf/facelets"
    template="test_layout.xhtml">

    <ui:define name="content">
        bunch 'o content
    </ui:define>

</ui:composition>

Anybody got a workaround?

Kukeltje
  • 12,223
  • 4
  • 24
  • 47
ccleve
  • 15,239
  • 27
  • 91
  • 157
  • not the answer to your question, but at the moment i wouldn't use JSF 2.2 yet. it is still under development and not yet released. did you try with the latest 2.1.x version? – fischermatte Jan 10 '13 at 00:09
  • @fischermatte: we need people trying beta's/pre-releases to test things... – Kukeltje Jun 09 '20 at 19:15

1 Answers1

0

I upgraded to 2.2.0-m08 and the problem went away.

ccleve
  • 15,239
  • 27
  • 91
  • 157
  • It seem to be back with 2.2.14 or a view earlier patch levels. also it is present with 2.3.2 (latest beta). – Roland Sep 29 '17 at 19:29