compile error:the root element must be well-formed.

Hi,

I'm new to JSF, trying it by using Tomcat 6, JDK 5, jsf 1.2.

I only have a simple jsp/jsp file along with the *.xml, the jsp like

<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>

<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>

<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c"%>

<f:view>

</f:view>

but when running it, there is compile error:

Jul 1, 2007 11:41:17 AM com.sun.faces.lifecycle.ELResolverInitPhaseListener populateFacesE

LResolverForJsp

INFO: JSF1027: [/jsf-simple] The ELResolvers for JSF were not registered with the JSP cont

ainer.

Jul 1, 2007 11:41:17 AM com.sun.faces.lifecycle.LifecycleImpl phase

WARNING: executePhase(RENDER_RESPONSE 6,com.sun.faces.context.FacesContextImpl@6963d0) thr

ew exception

javax.faces.FacesException: org.apache.jasper.JasperException: /pages/simple.jsp(1,2) T

he markup in the document preceding the root element must be well-formed.

at com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:413

)

at com.sun.faces.application.ViewHandlerImpl.executePageToBuildView(ViewHandlerImp

l.java:442)

at com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:115)

at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:10

6)

at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:251)

at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:144)

at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFil

terChain.java:290)

Can any one tell how to fix it?

Thanks

John

Toronto

[1861 byte] By [john_woo_canadaa] at [2007-11-27 9:21:24]
# 1

Try this

<!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:c="http://java.sun.com/jstl/core"

xmlns:f="http://java.sun.com/jsf/core">

<f:view>

</f:view>

</html>

lekshmia at 2007-7-12 22:15:14 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...