namespace of Facelets not work under Apache MyFaces 2.0

UI Components for JSF
Post Reply
Sidney
Posts: 13
Joined: 07 Jan 2010, 11:56

07 Jan 2010, 12:10

JSF IMPL: Apache MyFaces2.0 + PrimeFaces2.0.0

I Created a xhtml like following

Code: Select all

<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:p="http://primefaces.prime.com.tr/ui">
<head>
<h:outputText value="Hello"/>
<p:resources />
</head>
<body>
<p:editor/>
</body>
</html>
But when accessing this xhtml, I got the following html

Code: Select all

<html xmlns="http://www.w3.org/1999/xhtml" xmlns:p="http://primefaces.prime.com.tr/ui">
<head>Hello
<p:resources></p:resources>
</head>
<body>
<p:editor></p:editor>
</body>
</html>
The program didn't parse the namespace "http://primefaces.prime.com.tr/ui".

The following are the config of web.xml and faces-config.xml
web.xml

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xmlns="http://java.sun.com/xml/ns/javaee"
	xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
	xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
	id="WebApp_ID" version="2.5">
	<display-name>PrimeFaces-RS</display-name>
	<welcome-file-list>
		<welcome-file>index.html</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>*.jsf</url-pattern>
	</servlet-mapping>
	<servlet>
		<servlet-name>Resource Servlet</servlet-name>
		<servlet-class>
			org.primefaces.resource.ResourceServlet
		</servlet-class>
		<load-on-startup>2</load-on-startup>
	</servlet>
	<servlet-mapping>
		<servlet-name>Resource Servlet</servlet-name>
		<url-pattern>/primefaces_resource/*</url-pattern>
	</servlet-mapping>
	<context-param>
		<param-name>javax.faces.DEFAULT_SUFFIX</param-name>
		<param-value>.xhtml</param-value>
	</context-param>
</web-app>
faces-config.xml

Code: Select all

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

<faces-config xmlns="http://java.sun.com/xml/ns/javaee"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd"
	version="2.0">

</faces-config>
Why?
How to solv it?

Best Regards
Sidney Xu

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

07 Jan 2010, 15:28

Try mojarra-2.0 as myfaces-2.0 is alpha and not ready.

Sidney
Posts: 13
Joined: 07 Jan 2010, 11:56

08 Jan 2010, 06:32

hi guys,

Thanks for your help.

Everything is OK, after Changed to majarra2.0.2.

Best Regards,
Sidney Xu

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

08 Jan 2010, 18:36

Glad it works Sidney, as I've mentioned MyFaces is alpha and weird issues might happen.

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: Leslienek and 53 guests