ui:insert 未被 ui:define 取代

ui:insert not being replaced by ui:define

我正在创建一个 JSF 模板来遵循我的应用程序的布局...所以我创建了这个 layout.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:ui="http://xmlns.jcp.org/jsf/facelets"
    xmlns:h="http://xmlns.jcp.org/jsf/html">

<h:head>
    <link href="stylesheet.css" rel="stylesheet" type="text/css" />
</h:head>
<h:body>
    <f:loadBundle basename="mensagens.mensagens_pt_BR" var="msgs" />
    <ui:composition>
        <div id="page">
            <div id="header-container">
                <div id="nomeSistema">#{msgs.outNomeSistema}</div>
            </div>
            <div id="menu-login-container">
                <div id="menu"
                    style="width: 850px; height: 30px; border: solid 1px; padding: 15px;">
                    <ui:include src="/menu/menu.xhtml" />
                </div>
                <div id="login">
                    <ui:include src="/login/login.xhtml" />
                </div>
            </div>
            <div id="content-container">
                <div id="content">
                    <ui:insert name="content">
                        <h2>Default content</h2>
                    </ui:insert>
                </div>
            </div>
            <div id="footer-container">
                <div id="footer">
                    <h:outputText value="#{msg.versao}" />
                </div>
            </div>
        </div>
    </ui:composition>
</h:body>
</html>

这里是 comum.xhtml

<ui:composition xmlns="http://www.w3.org/1999/xhtml"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:ui="http://java.sun.com/jsf/facelets" template="layout.xhtml">
    <ui:define name="content">
        <h2>Testando template...</h2>
    </ui:define>
</ui:composition>

但是,当我在浏览器上访问 comum.xhtml 页面时。文本 默认内容 显示,而不是 Testando 模板....

我做错了什么?

找到了!

layout.xhtmlhtml 标签上 我把它从

<html xmlns="http://www.w3.org/1999/xhtml"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
    xmlns:h="http://xmlns.jcp.org/jsf/html">

<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">

现在,它正在运行。