Note that there are some explanatory texts on larger screens.

plurals
  1. POPrimeFaces Not Rendering
    text
    copied!<p>In my maven project, I created an "index.xhtml" file. When I built and ran the project, the web browser didn't show anything. When I view source, I could still see the source code, instead of the normal html tags.</p> <p>I have tried creating the XHTML file by:</p> <ol> <li>Selecting the project, right-click New.. and select Other.. and select "Web" category and then JSF Page.</li> <li>Selecting the project, right-click New.. and select Other.. and select "JavaServer Faces" category and then JSF Page.</li> <li>Selecting the project, right-click New.. and select Other.. and select "Other" category and then XHTML Page.</li> </ol> <p>None of the methods above worked.</p> <p><em><strong>Maven POM</em></strong></p> <pre><code>&lt;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"&gt; &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt; &lt;groupId&gt;ProfitV10&lt;/groupId&gt; &lt;artifactId&gt;ProfitV10&lt;/artifactId&gt; &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt; &lt;packaging&gt;war&lt;/packaging&gt; &lt;name&gt;ProfitV10&lt;/name&gt; &lt;properties&gt; &lt;endorsed.dir&gt;${project.build.directory}/endorsed&lt;/endorsed.dir&gt; &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt; &lt;/properties&gt; &lt;dependencies&gt; &lt;dependency&gt; &lt;groupId&gt;javax&lt;/groupId&gt; &lt;artifactId&gt;javaee-web-api&lt;/artifactId&gt; &lt;version&gt;6.0&lt;/version&gt; &lt;scope&gt;provided&lt;/scope&gt; &lt;/dependency&gt; &lt;dependency&gt; &lt;groupId&gt;org.primefaces&lt;/groupId&gt; &lt;artifactId&gt;primefaces&lt;/artifactId&gt; &lt;version&gt;3.3.1&lt;/version&gt; &lt;/dependency&gt; &lt;/dependencies&gt; &lt;repositories&gt; &lt;repository&gt; &lt;id&gt;prime-repo&lt;/id&gt; &lt;name&gt;PrimeFaces Maven Repository&lt;/name&gt; &lt;url&gt;http://repository.primefaces.org&lt;/url&gt; &lt;layout&gt;default&lt;/layout&gt; &lt;/repository&gt; &lt;/repositories&gt; &lt;build&gt; &lt;plugins&gt; &lt;plugin&gt; &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt; &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt; &lt;version&gt;2.3.2&lt;/version&gt; &lt;configuration&gt; &lt;source&gt;1.6&lt;/source&gt; &lt;target&gt;1.6&lt;/target&gt; &lt;compilerArguments&gt; &lt;endorseddirs&gt;${endorsed.dir}&lt;/endorseddirs&gt; &lt;/compilerArguments&gt; &lt;/configuration&gt; &lt;/plugin&gt; &lt;plugin&gt; &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt; &lt;artifactId&gt;maven-war-plugin&lt;/artifactId&gt; &lt;version&gt;2.1.1&lt;/version&gt; &lt;configuration&gt; &lt;failOnMissingWebXml&gt;false&lt;/failOnMissingWebXml&gt; &lt;/configuration&gt; &lt;/plugin&gt; &lt;plugin&gt; &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt; &lt;artifactId&gt;maven-dependency-plugin&lt;/artifactId&gt; &lt;version&gt;2.1&lt;/version&gt; &lt;executions&gt; &lt;execution&gt; &lt;phase&gt;validate&lt;/phase&gt; &lt;goals&gt; &lt;goal&gt;copy&lt;/goal&gt; &lt;/goals&gt; &lt;configuration&gt; &lt;outputDirectory&gt;${endorsed.dir}&lt;/outputDirectory&gt; &lt;silent&gt;true&lt;/silent&gt; &lt;artifactItems&gt; &lt;artifactItem&gt; &lt;groupId&gt;javax&lt;/groupId&gt; &lt;artifactId&gt;javaee-endorsed-api&lt;/artifactId&gt; &lt;version&gt;6.0&lt;/version&gt; &lt;type&gt;jar&lt;/type&gt; &lt;/artifactItem&gt; &lt;/artifactItems&gt; &lt;/configuration&gt; &lt;/execution&gt; &lt;/executions&gt; &lt;/plugin&gt; &lt;/plugins&gt; &lt;/build&gt; </code></pre> <p></p> <p><em><strong>web.xml</em></strong></p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"&gt; &lt;context-param&gt; &lt;param-name&gt;javax.faces.PROJECT_STAGE&lt;/param-name&gt; &lt;param-value&gt;Development&lt;/param-value&gt; &lt;/context-param&gt; &lt;servlet&gt; &lt;servlet-name&gt;Faces Servlet&lt;/servlet-name&gt; &lt;servlet-class&gt;javax.faces.webapp.FacesServlet&lt;/servlet-class&gt; &lt;load-on-startup&gt;1&lt;/load-on-startup&gt; &lt;/servlet&gt; &lt;servlet-mapping&gt; &lt;servlet-name&gt;Faces Servlet&lt;/servlet-name&gt; &lt;url-pattern&gt;/faces/*&lt;/url-pattern&gt; &lt;/servlet-mapping&gt; &lt;session-config&gt; &lt;session-timeout&gt; 30 &lt;/session-timeout&gt; &lt;/session-config&gt; &lt;welcome-file-list&gt; &lt;welcome-file&gt;faces/index.xhtml&lt;/welcome-file&gt; &lt;/welcome-file-list&gt; &lt;/web-app&gt; </code></pre> <p><em><strong>index.xhtml</em></strong></p> <pre><code>&lt;?xml version='1.0' encoding='UTF-8' ?&gt; &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; &lt;html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:p="http://primefaces.org/ui"&gt; &lt;h:head&gt; &lt;title&gt;Facelet Title&lt;/title&gt; &lt;/h:head&gt; &lt;h:body&gt; &lt;p:spinner /&gt; &lt;/h:body&gt; &lt;/html&gt; </code></pre> <p>That's the first scenario. The second scenario, I already have a NetBeans Web Application project running ok with PrimeFaces. The "index.html" did render. But when I created a new JSF page and included the PrimeFaces namespace, <code>xmlns:p="http://primefaces.org/ui"</code>, But this particular JSF and other newly created JSF page won't render.</p> <p>Must be something which I am missing, but I do not know what.</p> <p>My environment is as below:</p> <ul> <li>JDK6</li> <li>Netbeans 7.1.2</li> <li>PrimeFaces 3.3</li> <li>Apache 7.0.2</li> <li>Windows 7 (32-bit)</li> </ul> <p>Thanks.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload