4

我尝试设置 PrimeFaces 库。所以我使用“添加外部 jar”命令添加了 primefaces-3.4.1.jar。比我添加命名空间:xmlns:p="http://primefaces.org/ui到 html 标记。根据官方文档,这就是它的全部内容,用于设置它。

我尝试将<p:editor/>组件添加到我的页面,但未显示。

我的项目配置是:Eclipse,JSF 2.1 on Glassfish 3.1

4

3 回答 3

4

Apparently you did the "add external jar" command wrong. It's not clear from the question how exactly you performed this step, but this should be just a matter of dropping the JAR file in its entirety in the project's /WEB-INF/lib folder the usual way (as you would do for every 3rd party JAR file the webapp depends on). The way you put the question indicates that you weren't aware about this after all.

Really nothing more needs to be done. If you have fiddled around in project's Build Path properties, then you should undo that all to avoid possible collisions in the future. Eclipse is smart enough to set the necessary things automatically right whenever you drop a JAR in projects's /WEB-INF/lib folder.

See also:

于 2012-10-31T01:18:29.123 回答
3

我想这是同样的问题和解决方案:Simple primefaces application not working

web.xml 中缺少 servlet 映射:

<servlet-mapping>
  <servlet-name>Faces Servlet</servlet-name>
  <url-pattern>*.xhtml</url-pattern>
</servlet-mapping>
于 2013-01-19T19:02:27.093 回答
0

PrimeFaces jar(在我的例子中是primefaces-7.0.jar)在运行时必须在文件夹/WEB-INF/lib 中可用。

于 2020-04-14T10:23:04.147 回答