我的<!DOCTYPE html>
声明已从我的JSF页面中删除,这很混乱。
同一问题被问过很多次:
HTML doctype declaration in JSF
DocType is not showing in the rendered output from JSF
JSF template: rendered page missing DOCTYPE
问题是,this Jira entry说该错误已修复。显然不是。我正在使用最新版本:
<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>
供参考,这是我的页面:
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>
有人有解决方法吗?
我升级到2.2.0-m08,问题消失了。
您的web.xml中是否有javax.faces.FACELETS_REFRESH_PERIOD?在我们的项目中,我注意到,只要将参数设置为-1,我们的文档类型就会消失。仍在尝试找出原因