Results 1 to 1 of 1
  1. #1
    wiston is offline Member
    Join Date
    Jan 2016
    Posts
    1
    Rep Power
    0

    Default Cannot display index.xhtml with TomCat and JSF + Primefaces

    Hi, i would like to ask, how it is possible, that i cannot open index.xhtml with use of Tomcat? I am trying creat some of the primefaces components. I created Java Dynamic Web Project and add libraries - jsf-api, jsf-impl and primefaces .JAR.

    Here is my index.xhtml file:
    Java Code:
     <?xml version="1.0" encoding="UTF-8" ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml"
    	xmlns:h="http://java.sun.com/jsf/html"
    	xmlns:f="http://java.sun.com/jsf/core"
    	xmlns:p="http://primefaces.org/ui">
    <h:head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>Insert title here</title>
    </h:head>
    <h:body>
     
    <p:button outcome="productDetail" value="Bookmark" icon="ui-icon-star">
        <f:param name="productId" value="10" />
    </p:button>
     
    </h:body>
    </html>
    And here is my web.xml file:
    Java Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" id="WebApp_ID" version="3.1">
      <display-name>JSF</display-name>
      <welcome-file-list>
      <welcome-file>index.xhtml</welcome-file>
        <welcome-file>index.html</welcome-file>
        <welcome-file>index.htm</welcome-file>
        <welcome-file>index.jsp</welcome-file>
      </welcome-file-list>
      <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>
    </web-app>

    And JPG of project structure.

    When i write some simple code into file index.html, Tomcat just display it. But if I rename the index.html to index.xhtml and add some primefaces components, I get only 404Error.

    Can you please help me? Thanks a lot!
    Attached Thumbnails Attached Thumbnails Cannot display index.xhtml with TomCat and JSF + Primefaces-structure.jpg  

Similar Threads

  1. JSF - PrimeFaces, why both? Is one enough? If not why?
    By bineeth in forum JavaServer Faces (JSF)
    Replies: 1
    Last Post: 09-16-2013, 09:59 PM
  2. JSF Designer and PrimeFaces License
    By rome2 in forum JavaServer Faces (JSF)
    Replies: 1
    Last Post: 08-22-2013, 11:28 AM
  3. Replies: 7
    Last Post: 07-29-2013, 02:27 PM
  4. Replies: 0
    Last Post: 07-06-2012, 01:22 PM
  5. Replies: 5
    Last Post: 07-21-2010, 11:45 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •