如何使用现有的 JSF 应用程序配置primefaces?

Rit*_*esh 1 eclipse jsf primefaces

我是 JSF 的初学者,当我在 Eclipse 上配置 Primefaces 时,我遇到了异常。我已经完成了以下操作,将primefaces 添加到我现有的JSF 应用程序中。

  1. 将 jar 文件添加primefaces-3.5.jar到库中
  2. 然后我修改了我的xhtml页面,xhtml页面的内容如下

    xmlns:p="http://primefaces.prime.com.tr/ui"

然后它显示错误

NLS missing message: CANNOT_FIND_FACELET_TAGLIB 
in: 
org.eclipse.jst.jsf.core.validation.internal.facelet.messages
Run Code Online (Sandbox Code Playgroud)

这里可以做些什么来解决这个问题?

Eclipse 细节是

Eclipse Java EE IDE for Web Developers.
Version: Kepler Release
Build id: 20130614-0229
Run Code Online (Sandbox Code Playgroud)

Zaw*_* oo 5

更改xmlns:p="http://primefaces.prime.com.tr/ui"xmlns:p="http://primefaces.org/ui"

它在您的页面中缺少以下标签库。

<html xmlns="http://www.w3.org/1999/xhtml"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:p="http://primefaces.org/ui">
    ...
</html>
Run Code Online (Sandbox Code Playgroud)

确保设置将 jar 文件放在WEB-INF文件夹中

+ WEB-INF
    - primefaces-3.5-XXX.jar
    - jsf-api_2.1_spec-xx.jar -> When your server already exist as a server module, your don't need to put.
Run Code Online (Sandbox Code Playgroud)

  • 你忘了**解释**问题,所以这里是:taglib URI `http://primefaces.prime.com.tr/ui` 特定于 PrimeFaces 2.x,但是 OP 正在尝试使用 PrimeFaces 3.x 具有不同的 taglib URI,`http://primefaces.org/ui`。因此出现此错误。毕竟,OP 应该阅读 PrimeFaces 3.x 文档和教程,而不是 2.x 文档和教程。 (5认同)