0

I am trying to run a simple test XHTML in Wildfly, but unfortunately the browser (http://localhost:8080/testproj/test.xhtml) only shows the XML file and not its result. I use Maven for the dependencies and I run the Wildfly server on Ubuntu 14.04.2. Wildfly seems to deploy the testproj.war without errors.

I'm not sure whether to search the error in my Wildfly configuration or within my program code. Could anybody plz help me out?

My test.xhtml:

<!DOCTYPE html>
<html   xmlns="http://www.w3c.org/1999/xhtml"
        xmlns:h="http://java.sun.com/jsf/html"
        xmlns:p="http://primefaces.org/ui"
        xmlns:f="http://xmlns.jcp.org/jsf/core">
    <h:head/>
    <h:body>
        <p:outputLabel value="my test output"/>
    </h:body>
</html>

Inserted part in my pom.xml:

    <dependency>  
        <groupId>org.primefaces</groupId>
        <artifactId>primefaces</artifactId>
        <version>5.2</version>
    </dependency>

My installed Java version:

user@userpc:~$ java -version
Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar 
java version "1.8.0_45"
Java(TM) SE Runtime Environment (build 1.8.0_45-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.45-b02, mixed mode)

EDIT [solved]:

Added lines to my web.xml. It now looks like this and parsing now works:

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

<web-app 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_3_1.xsd"
     version="3.1">
    <session-config>
        <session-timeout>
            30
        </session-timeout>
    </session-config>
    <servlet>
        <servlet-name>facesServlet</servlet-name>
        <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
    </servlet>
    <servlet-mapping>
        <servlet-name>facesServlet</servlet-name>
        <url-pattern>*.xhtml</url-pattern>
    </servlet-mapping>
</web-app>
Socrates
  • 8,724
  • 25
  • 66
  • 113
  • 1
    Show the configuration of `FacesServlet` in web.xml and the URL you're using to access to the page. – Luiggi Mendoza Jun 20 '15 at 04:12
  • Ok, I followed the duplicate link and solved my case. Will post it as an answer in a sec. Thanks a lot and sorry for duplicating! Wasn't sure how to search for this issue. – Socrates Jun 20 '15 at 10:35

0 Answers0