Java 找不到命名空间 xmlns:p="http://primefaces.org/ui" 的库
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/19498873/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
No library found for namespace xmlns:p="http://primefaces.org/ui"
提问by Anand Devaraj
I am trying to add primefaces for my JSF application using Netbeans IDE. While adding the namespace for primefaces in xhtml page, i am facing the errors as "No library found for namespace xmlns:p="http://primefaces.org/ui".
我正在尝试使用 Netbeans IDE 为我的 JSF 应用程序添加primefaces。在 xhtml 页面中为 primefaces 添加命名空间时,我面临的错误是“找不到命名空间 xmlns:p="http://primefaces.org/ui”的库。
My Environment setup JDK 1.7, Maven 3.0.4, Tomcat 7, Primefaces 3.3, Netbeans IDE, JSF 2.1.2
我的环境设置 JDK 1.7、Maven 3.0.4、Tomcat 7、Primefaces 3.3、Netbeans IDE、JSF 2.1.2
And in pom.xml, i have added the primefaces repo and dependency as
在 pom.xml 中,我添加了primefaces repo 和依赖项作为
<repositories>
<repository>
<id>prime-repo</id>
<name>Prime Repo</name>
<url>http://repository.primefaces.org</url>
</repository>
</repositories>
<dependency>
<groupId>org.primefaces</groupId>
<artifactId>primefaces</artifactId>
<version>3.3</version>
</dependency>
Also i have tried to change the namespace as specified in this [blog]
我还尝试更改此 [博客] 中指定的命名空间
xmlns:p="http://primefaces.prime.com.tr/ui"
It was always not working.
它总是不工作。
Any help will be appreciated. Thanks in advance.
任何帮助将不胜感激。提前致谢。
回答by Aneta St?pień
There's an issuein NetBeans, described hereand fixed in version 7.4. In this case the error should be gone after application is deployed on Tomcat server.
NetBeans 中存在一个问题,在此处描述并在 7.4 版中修复。在这种情况下,在 Tomcat 服务器上部署应用程序后,错误应该消失了。
(Posted just to keep the solution suggestions out of the comments.)
(发布只是为了将解决方案建议排除在评论之外。)
回答by chango
Copy primefaces-p.taglib.xml from META-INF in primefaces.jar dependency, to META-INF in your web module:
将 primefaces-p.taglib.xml 从 primefaces.jar 依赖项中的 META-INF 复制到 Web 模块中的 META-INF: