File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSF and the fly likes templates Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "templates" Watch "templates" New topic


Dura Hurtado
Ranch Hand

Joined: Feb 16, 2011
Posts: 120
Hi I am trying to use templates. My app use JSF 2.0 and primefaces.

I have debugged it and it works well, until it reaches the the template; the code is below and the error is:

javax.faces.view.facelets.FaceletException: Error Parsing /welcome1.xhtml: Error Traced[line: 3] The processing instruction target matching "[xX][mM][lL]" is not allowed.
at com.sun.faces.facelets.compiler.SAXCompiler.doCompile(
at com.sun.faces.facelets.compiler.SAXCompiler.doCompile(


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

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">

<html xmlns="" xmlns:ui=""

xmlns:f="" xmlns:h="">

<ui:composition template="/WEB-INF/facelets/template/defaultLayout.xhtml">

<ui:define name="title">


<ui:define name="content">

<!-- contenido de la página-->





¿Any clue?

Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15629

The very first item on the very first line of your XML file must start with "<?xml " in column 1. If anything preceeds that, the XML parser/validator will object.

If you'll notice, your error message is complaining about finding it on line 3.

Customer surveys are for companies who didn't pay proper attention to begin with.
wood burning stoves
subject: templates
Similar Threads
Facelets and JSF
Facelets Problem
Bug in chrome
Problem rendering facelets templates
hiding pages behind WEB-INF?