JSF模板破坏XML命名空间“没有taglibrary存在”

时间:2014-04-03 08:09:10

标签: jsf jsf-2 jsf-2.2

我遇到了一个问题,即JSF在加载页面时会发出警告:

  

警告:此页面调用XML命名空间http://www.w3.org/1999/   使用前缀li声明但该命名空间不存在taglibrary。

这很好用:

<?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:f="http://java.sun.com/jsf/core"
    xmlns:ui="http://java.sun.com/jsf/facelets">
<h:body>
    <f:view>
        <ul>
            <li>Test</li>
        </ul>
    </f:view>
</h:body>
</html>

然而......一旦我将UL标签移动到包含文件中,它就会失败:

<?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:f="http://java.sun.com/jsf/core"
    xmlns:ui="http://java.sun.com/jsf/facelets">
<h:body>
    <f:view>
        <ui:include src="/include/test.xhtml"></ui:include>
    </f:view>
</h:body>
</html>

使用test.xhtml:

<ui:composition xmlns="http://www.w3.org/1999/"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:p="http://primefaces.org/ui">
    <ul>
        <li>Test</li>
    </ul>
</ui:composition>

0 个答案:

没有答案
相关问题