【发布时间】:2015-01-13 02:11:55
【问题描述】:
我正在尝试将 primefaces 集成到我的应用程序中,因此我关注 the primefaces user guide。我没有任何依赖问题,但是在进入指南的第一个示例时,除了空白页之外我什么也没得到。
<!DOCTYPE html>
<html xmlns="http://www.w3c.org/1999/xhtml" xmlns:p="http://primefaces.org/ui"><head id="j_idt2"></head><body>
<p:editor></p:editor></body>
</html>
根据指南,我希望获得一个富文本编辑器,但没有显示任何内容。在我的html代码下面。你能看出有什么错误吗?
<!DOCTYPE html>
<html xmlns="http://www.w3c.org/1999/xhtml"
xmlns:h="http://xmlns.jcp.org/jsf/html"
xmlns:p="http://primefaces.org/ui">
<h:head></h:head>
<h:body>
<p:editor />
</h:body>
</html>
P.E.:我还添加了 primefaces 和 myfaces 作为依赖项to my pom.xml:
<dependencies>
<dependency>
<groupId>org.primefaces</groupId>
<artifactId>primefaces</artifactId>
<version>5.1</version>
</dependency>
<dependency>
<groupId>org.apache.myfaces.core</groupId>
<artifactId>myfaces-api</artifactId>
<version>2.2.3</version>
</dependency>
<dependency>
<groupId>org.apache.myfaces.core</groupId>
<artifactId>myfaces-impl</artifactId>
<version>2.2.3</version>
</dependency>
</dependencies>
web.xml 中的配置似乎也不错:
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
version="3.1">
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.xhtml</url-pattern>
</servlet-mapping>
<context-param>
<param-name>primefaces.THEME</param-name>
<param-value>bootstrap</param-value>
</context-param>
</web-app>
【问题讨论】:
-
您是否将 primefaces jar 添加到类路径或 pom 中?显示你的 web.xml
-
尝试使用简单的 PrimeFaces 组件,例如
<p:inputText />。 -
@JaqenH'ghar:是的,我的 pom.xml 中有 primefaces 和 myfaces
-
@Omar 相同的结果 :-( w3c.org/1999/xhtml" xmlns:p="primefaces.org/ui"><head id="j_idt2">
标签: maven jsf jakarta-ee jsf-2 primefaces