Hi all
I have tried to port JSF 1 + JSP to JSF 2 + Facelets but I have stumbled onto this error when I viewed the page in the web browser:
XML Parsing Error: no element found
Location: http://localhost/index.xhtml
Line Number 1, Column 1:
The codes of index.xhtml are:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.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:ui="http://java.sun.com/jsf/facelets">
<h:head>
<title><ui:insert name="title">Default title</ui:insert></title>
<ui:insert name="metaHeader">
<ui:include src="../includes/inc_headers.xhtml"/>
</ui:insert>
</h:head>
<h:body>
Testing
</h:body>
</html>
The codes of inc_headers.xhtml are:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<ui:composition xmlns:ui="http://java.sun.com/jsf/facelets">
<ui:define name="metaHeader">
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<link rel="stylesheet" type="text/css" media="screen" href="../stylesheets/main.css"/>
</ui:define>
</ui:composition>
Can anyone see the obvious problem(s) in the codes?
Thanks