获取错误"No library found for this namespace"



我正在使用Netbeans6.8并尝试使用JSF2和Primefaces构建一个简单的项目。

将jar jsf-impl-2.0.3.jar,jstl-1.0.2.jar, jsf-api-2.0.3.jar, primefaces-2.2.1.jar放在lib文件夹中,我在NetBeans编辑器中得到这个错误"No library found for this namespace"

login.xhtml页面的代码如下:

<html xmlns="http://www.w3c.org/1999/xhtml" 
    xmlns:f="http://java.sun.com/jsf/core" 
    xmlns:h="http://java.sun.com/jsf/html" 
    xmlns:p="http://primefaces.prime.com.tr/ui"> 
<h:head> 
    <link type="text/css" rel="stylesheet" href="themes/bluesky/skin.css" /> 
</h:head> 
<h:body> 
   .....

谁能告诉我是什么原因,我得到这个错误。

我把我的faces-config.xml放好了

您的默认xmlns命名空间是错误的。它应该指向www.w3.org,而不是www.w3c.org

修改如下:

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

相关内容