web-dev-qa-db-ja.com

警告:このページでは、プレフィックス[HTML要素名]で宣言されたXML名前空間が必要ですが、その名前空間のタグライブラリは存在しません

1つの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>

ページをロードすると、このエラーメッセージがページの下部に表示されます。

Warning: This page calls for XML namespace declared with prefix body but no taglibrary exists for that namespace.
Warning: This page calls for XML namespace declared with prefix title but no taglibrary exists for that namespace.
Warning: This page calls for XML namespace declared with prefix link but no taglibrary exists for that namespace.
Warning: This page calls for XML namespace declared with prefix img but no taglibrary exists for that namespace.
Warning: This page calls for XML namespace declared with prefix div but no taglibrary exists for that namespace.
Warning: This page calls for XML namespace declared with prefix div but no taglibrary exists for that namespace.
Warning: This page calls for XML namespace declared with prefix div but no taglibrary exists for that namespace.
Warning: This page calls for XML namespace declared with prefix div but no taglibrary exists for that namespace.
Warning: This page calls for XML namespace declared with prefix div but no taglibrary exists for that namespace.
Warning: This page calls for XML namespace declared with prefix div but no taglibrary exists for that namespace.
Warning: This page calls for XML namespace declared with prefix div but no taglibrary exists for that namespace.
Warning: This page calls for XML namespace declared with prefix div but no taglibrary exists for that namespace.

問題を解決する方法を教えてください。問題はJSFタグにあると思います。

17
Peter Penzov

この名前空間宣言を試してください

<?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">
31
Jigar Joshi

これを追加するだけです

xmlns = "http://www.w3.org/1999/xhtml

w3CだけでなくW3でも、非常にうまく機能します。

9
lahbib