我一直在学习facelets,而且我似乎无法使用简单的<ui:include>
标签。
我有以下xhtml文件:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:ui="http://java.sun.com/jsf/facelets">
<h:head />
<body>
<f:view>
<h:form>
<ui:include src="header.xhtml" />
Body text here.
</h:form>
</f:view>
</body>
</html>
以下是header.xhtml(在同一目录中):
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:ui="http://java.sun.com/jsf/facelets">
<h:head />
<body>
<ui:composition>
<h2>Our Company</h2>
</ui:composition>
</body>
</html>
但是当我在Chrome中打开第一个文件时,<h2>Our Company<\h2>
无法显示。我做错了什么?