0

I'm trying to create simle page with JSF 2.3 and primeFaces, but what I got is a blank page, jsf tag are not interpreted by browser. I was reading a lot of similar questions but nothing help.

web.xml file:

    <?xml version="1.0" encoding="UTF-8"?>

<web-app version="4.0" 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_4_0.xsd">
    <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>

    <welcome-file-list>
        <welcome-file>index.xhtml</welcome-file>
    </welcome-file-list>

</web-app>

index.xhtml

<!DOCTYPE html>
<html lang="en"
      xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
      xmlns:p="http://primefaces.org/ui">
<h:head>
    <title>Hello World JSF 2.3</title>
</h:head>
<h:body>
    <h:form>
        <h3 style="margin-top:0">Client</h3>
        <p:tree value="#{treeBasicView.root}" var="node">
            <p:treeNode>
                <h:outputText value="#{node}" />
            </p:treeNode>
        </p:tree>

        <h3>Ajax</h3>
        <p:tree value="#{treeBasicView.root}" var="node" dynamic="true">
            <p:treeNode>
                <h:outputText value="#{node}" />
            </p:treeNode>
        </p:tree>
    </h:form>

</h:body>
</html>
Di5bk90
  • 1
  • 1
  • read [this](https://stackoverflow.com/questions/3112946/jsf-returns-blank-unparsed-page-with-plain-raw-xhtml-xml-el-source-instead-of-rehttps://stackoverflow.com/questions/3112946/jsf-returns-blank-unparsed-page-with-plain-raw-xhtml-xml-el-source-instead-of-re) please – WoAiNii Apr 06 '20 at 20:44
  • 2
    JSF tags are **never** interpreted by the browser but always on the server. And did you try posting your title in a search engine: https://duckduckgo.com/?q=JSF+tag+are+not+interpreted+by+browser+site%3Astackoverflow.com Many relevant posts – Kukeltje Apr 06 '20 at 20:50
  • 3
    Does this answer your question? [JSF returns blank/unparsed page with plain/raw XHTML/XML/EL source instead of rendered HTML output](https://stackoverflow.com/questions/3112946/jsf-returns-blank-unparsed-page-with-plain-raw-xhtml-xml-el-source-instead-of-re) – WoAiNii Apr 06 '20 at 20:51

0 Answers0