Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jsf-2/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jsf 2 警告:此页面调用以前缀[HTML元素名称]声明的XML命名空间,但该命名空间不存在taglibrary_Jsf 2_Facelets - Fatal编程技术网

Jsf 2 警告:此页面调用以前缀[HTML元素名称]声明的XML命名空间,但该命名空间不存在taglibrary

Jsf 2 警告:此页面调用以前缀[HTML元素名称]声明的XML命名空间,但该命名空间不存在taglibrary,jsf-2,facelets,Jsf 2,Facelets,我有一个JSF页面的问题。这是源代码: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns:h="http://java.sun.com/jsf/html"> <head> <title>Login</title>

我有一个JSF页面的问题。这是源代码:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns:h="http://java.sun.com/jsf/html">
    <head>
        <title>Login</title>
        <link rel="stylesheet" type="text/css" href="resources/css/style.css" />
        <script src="resources/js/cufon-yui.js" type="text/javascript"></script>
        <script src="resources/js/ChunkFive_400.font.js" type="text/javascript"></script>
        <script type="text/javascript">
            Cufon.replace('h1',{ textShadow: '1px 1px #fff'});
            Cufon.replace('h2',{ textShadow: '1px 1px #fff'});
            Cufon.replace('h3',{ textShadow: '0px 1px #000'});
            Cufon.replace('.back');
        </script>
    </head>
    <body>
        <div class="wrapper">
            <div class="content">
                <div id="form_wrapper" class="form_wrapper">                    
                    <h:form class="login active">
                        <h3><img style="text-align:center" src="resources/images/title.png"/></h3>
                        <div>
                            <label>Username:</label>
                            <h:inputText value="#{loginController.user}" autocomplete="off"/>                           
                        </div>
                        <div>
                            <label>Password:</label>
                            <h:inputSecret value="#{loginController.password}" autocomplete="off"/>                         
                        </div>
                        <div class="bottom">    
                                                        <h:commandButton label="Login" value="Login" action="#{loginController.userCompare}"/>
                            <div class="clear"></div>
                        </div>
                    </h:form>                   
                </div>

                            <div id="error_message" style="text-align:center; padding-top:50px; font-style:normal; font-size:20px">
                                #{loginController.error_Database}
                                #{loginController.error_Message}
                            </div>

            </div>          
        </div>  
    </body>
</html>

你能告诉我怎么解决这个问题吗?我想问题出在JSF标记中。

试试这个名称空间声明

<?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=”http://www.w3.org/1999/xhtml

它不仅是W3C,而且是W3,它工作得非常好,

我使用了xmlns:h=“”,我得到了上面的错误。当我将它改为xmlns:h=“”,它工作得很好!Wala!“xmlns.jcp.org/*”名称空间是更新的Java EE 7+URI,也请看,您好,我已经有xmlns=“”,并且xmlns:h=“我仍然得到了许多此类错误。
<?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">