TL; DR: я не могу заставить заголовок DOCTYPE появляться на моих страницах JSF.
Я только что унаследовал проект JSF 1.2, с некоторыми проблемами отображения в IE. Я новичок в JSF, но я думаю, что проблемы связаны с тем фактом, что отображаемые страницы (из "источника просмотра") не содержат надлежащих DOCTYPE
.
Страницы состоят из нескольких частей, собранных вместе с использованием нескольких слоев <ui:composition>
. Типичная страница будет выглядеть так:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
template="../layout/template.xhtml">
<ui:define name="body">
<!-- html content goes here... -->
</ui:define>
</ui:composition>
Тогда ../layout/template.xhtml
имеет:
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
template="./headertemplate.xhtml">
<ui:define name="menuSelection">
<ui:insert name="menuSelection"/>
</ui:define>
<ui:define name="body">
<ui:insert name="body"/>
</ui:define>
<ui:define name="footer">
<div class="footer">
<ui:include src="footer.xhtml"/>
</div>
</ui:define>
</ui:composition>
И, наконец, headertemplate.xhtml
:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
contentType="text/html">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<body>
<ui:insert name="body" />
</body>
</html>
</ui:composition>
Я упустил много xmlns
строк для краткости; Я надеюсь, вы поняли идею.
Как я могу заставить DOCTYPE отображаться на отображаемых страницах?