2017-03-19 207 views
0

我是PrimeFaces的新手,我试图学习,但是我遇到了有关安装PrimeFaces的问题,组件不渲染。PrimeFaces 6.0不会渲染

到目前为止我已经尝试过。

PrimeFaces Not Rendering

PrimeFaces components are not rendered in browser in spite of dependency being present

Simple primefaces application not working

这里是不工作的代码。

I tried this code

输出:

Output

web.xml中(内部的WebContent的/ WEB-INF)

<?xml version="1.0" encoding="UTF-8"?> 
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" version="3.0"> 
    <display-name>jsfmav</display-name> 
    <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>/faces/*</url-pattern> 
    </servlet-mapping> 
    <servlet-mapping> 
    <servlet-name>Faces Servlet</servlet-name> 
    <url-pattern>*.jsf</url-pattern> 
</servlet-mapping> 
    <context-param> 
    <description>State saving method: 'client' or 'server' (=default). See JSF Specification 2.5.2</description> 
    <param-name>javax.faces.STATE_SAVING_METHOD</param-name> 
    <param-value>client</param-value> 
    </context-param> 
    <context-param> 
    <param-name>javax.servlet.jsp.jstl.fmt.localizationContext</param-name> 
    <param-value>resources.application</param-value> 
    </context-param> 
    <listener> 
    <listener-class>com.sun.faces.config.ConfigureListener</listener-class> 
    </listener> 
</web-app> 

的pom.xml

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 
    <modelVersion>4.0.0</modelVersion> 
    <groupId>com.sapo</groupId> 
    <artifactId>jsfmav</artifactId> 
    <version>0.0.1-SNAPSHOT</version> 
    <name>JSFMav</name> 

    <dependencies> 
    <dependency> 
    <groupId>org.primefaces</groupId> 
    <artifactId>primefaces</artifactId> 
    <version>6.0</version> 
</dependency> 
</dependencies> 


<build> 
    <plugins> 

     </plugins> 
</build> 

</project> 

项目浏览 Project explorer

的Tomcat 7.0,JSF 2.2,PrimeFaces 6.0

+0

在xhtml中有名称空间,h:头,h:身体等吗?尝试添加PF库到pom –

+0

是的,我有。此外,我添加了pf存储库,但没有更新我的问题。 –

回答

1

我解决了。我不知道如何,但它的工作原理。如果有人在将来需要更详细的检查了这一点

Here

我所做的一切在这里一步从无到有一步,它的工作,怪异。