0
votes

I'm pretty new at PrimeFaces and I'm trying to learn, but I got problems about setup PrimeFaces, components doesn't render.

There is what I've tried so far.

PrimeFaces Not Rendering

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

Simple primefaces application not working

Here's the code which doesn't work.

I tried this code

Output:

Output

web.xml(Inside of 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 Project explorer

Tomcat 7.0, JSF 2.2, PrimeFaces 6.0

1
Do you have namespaces, h:head, h:body etc in xhtml? Try adding the PF repository to the pomJaqen H'ghar
Yes I have. Also I added pf repository but didn't update my question yet.Sarper Kumcu

1 Answers

1
votes

I solved. I don't know how but It works. If someone needs more detail in the future check this out

Here

I did everything here step by step from scratch, and it worked, weird.