You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Ray Clark <rc...@yahoo.com> on 2005/02/13 04:53:29 UTC

Tiles with MyFaces returns a blank page

I am just now finding time to try tiles with my test
app.  I am running in to problems with my first try.
:(

I figure I have a setup problem of some kind.  That
being the case I'm not sure which files would be
helpful to post.  So I'll just post my error and a
couple of files.

I have a non tiles login page that validates the
userid and password typed in.  If found in the
database then the backing bean sets the action to
transfer to the first page of the app.  That first
page comes up blank with this error in the log file.

20050212 21:36:32 ERROR [http-8080-Processor24]
taglib.UIComponentTagUtils - Component
javax.faces.component.UIViewRoot is no ValueHolder,
cannot set value.
20050212 21:36:32 WARN  [http-8080-Processor24]
html.HtmlRenderKitImpl - Unsupported
component-family/renderer-type:
javax.faces.ViewRoot/javax.faces.Text
20050212 21:36:32 WARN  [http-8080-Processor24]
html.HtmlRenderKitImpl - Unsupported
component-family/renderer-type:
javax.faces.ViewRoot/javax.faces.Text
20050212 21:36:32 WARN  [http-8080-Processor24]
html.HtmlRenderKitImpl - Unsupported
component-family/renderer-type:
javax.faces.ViewRoot/javax.faces.Text
20050212 21:36:32 WARN  [http-8080-Processor24]
html.HtmlRenderKitImpl - Unsupported
component-family/renderer-type:
javax.faces.ViewRoot/javax.faces.Text
20050212 21:36:32 WARN  [http-8080-Processor24]
html.HtmlRenderKitImpl - Unsupported
component-family/renderer-type:
javax.faces.ViewRoot/javax.faces.Text
20050212 21:36:32 WARN  [http-8080-Processor24]
html.HtmlRenderKitImpl - Unsupported
component-family/renderer-type:
javax.faces.ViewRoot/javax.faces.Text
20050212 21:36:32 WARN  [http-8080-Processor24]
html.HtmlRenderKitImpl - Unsupported
component-family/renderer-type:
javax.faces.ViewRoot/javax.faces.Text
20050212 21:36:32 WARN  [http-8080-Processor24]
html.HtmlRenderKitImpl - Unsupported
component-family/renderer-type:
javax.faces.ViewRoot/javax.faces.Text
20050212 21:36:32 WARN  [http-8080-Processor24]
html.HtmlRenderKitImpl - Unsupported
component-family/renderer-type:
javax.faces.ViewRoot/javax.faces.Text

Here is part of the tiles.xml file.  The page that
comes up blank is the welcome.jsp page.

<tiles-definitions>
    <definition name="default.layout"
path="/secure/tiles/template.jsp" >
        <put name="header"
value="/secure/tiles/header.jsp" />
        <put name="menu"
value="/secure/tiles/navigation.jsp" />
    </definition>

    <definition name="/welcome.tiles"
extends="default.layout" >
        <put name="body"
value="/secure/misc/welcome.jsp" />
    </definition>

	<!-- workaround for non-tiles JSF pages-->
    <definition name="non.tiles1"
path="/secure/login.jsp" />	
 
</tiles-definitions>

The template was taken almost verbatim from the
examlpe.  Here it is.

<%@ page session="false" %>
<%@ page contentType="text/html;charset=UTF-8"
language="java" %>
<%@ taglib prefix="f"
uri="http://java.sun.com/jsf/core" %>
<%@ taglib prefix="h"
uri="http://java.sun.com/jsf/html" %>
<%@ taglib prefix="tiles"
uri="http://struts.apache.org/tags-tiles" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01
Transitional//EN">
<html>
	<head>
		<meta http-equiv="Content-Type"
content="text/html;CHARSET=iso-8859-1" />
		<title>Myfaces - Tiles</title>
		<!-- link rel="stylesheet" type="text/css"
href="css/tiles.css" / -->
	</head>
	<f:view>
		<body>
			<div id="lftBar">
				<f:subview id="menu">
					<tiles:insert attribute="menu" flush="false" />
				</f:subview>
			</div>
			<div id="level0">
				<div id="level1">
					<div id="topBar">
						<f:subview id="header">
							<tiles:insert attribute="header"
flush="false"/>
						</f:subview>
					</div>
					<div id="level2">
						<f:subview id="content">
							<tiles:insert attribute="body" flush="false"/>
						</f:subview>
					</div>
				</div>
			</div>
		</body>
	</f:view>
</html>

Here is the header.jsp file.

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

Here is the navigation.jsp file.

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

Here is the welcome.jsp file.

<%@ taglib uri="http://java.sun.com/jsf/html"
prefix="h"%>
<%@ taglib uri="http://java.sun.com/jsf/core"
prefix="f"%>
<%@ taglib uri="/WEB-INF/tld/customjsf.tld"
prefix="cjsf" %>
<%@ taglib uri="http://myfaces.apache.org/extensions"
prefix="x"%>

	<h:outputText value="Welcome to JavaServer Faces, "/>
	<h:outputText value="#{userBean.userTo.name}"/>


Ok, in case you need it, here is the
tiles-faces-config.xml file.

<?xml version="1.0"?>

<!DOCTYPE faces-config PUBLIC
  "-//Sun Microsystems, Inc.//DTD JavaServer Faces
Config 1.0//EN"
  "http://java.sun.com/dtd/web-facesconfig_1_0.dtd" [
<!ENTITY managed-beans_gen          SYSTEM
"managed-beans_gen.xml">
<!ENTITY sample-navigation-rules    SYSTEM
"sample-navigation-rules.xml">
 <!ENTITY converters_gen    SYSTEM
"converters_gen.xml">
]>

<faces-config>
    <application>
       
<view-handler>org.apache.myfaces.application.jsp.JspTilesViewHandlerImpl</view-handler>
    </application>

	<!-- global navigation rules -->
	<!-- page specific navigation rules -->
	<navigation-rule>
		<from-view-id>/secure/login.jsp</from-view-id>
		<navigation-case>
			<from-outcome>loginSuccess</from-outcome>
			<to-view-id>/secure/misc/welcome.jsp</to-view-id>
			<redirect/>
		</navigation-case>
		<navigation-case>
			<from-outcome>loginFailed</from-outcome>
			<to-view-id>/secure/loginError.jsp</to-view-id>
			<redirect/>
		</navigation-case>
		<navigation-case>
			<from-outcome>internalError</from-outcome>
			<to-view-id>/secure/internalError.jsp</to-view-id>
			<redirect/>
		</navigation-case>
	</navigation-rule>

	<managed-bean> 
		<managed-bean-name>userBean</managed-bean-name>
	
<managed-bean-class>com.javawebapps.todolist.model.UserBean</managed-bean-class>

		<managed-bean-scope>request</managed-bean-scope>
	</managed-bean>
</faces-config>

I think I have the web.xml file right.  I merged the
one from the example in with mine.  Since it is long I
didn't send it.

Any of you guys see what is wrong with my setup?

Thanks a bunch.
Ray


		
__________________________________ 
Do you Yahoo!? 
Yahoo! Mail - Helps protect you from nasty viruses. 
http://promotions.yahoo.com/new_mail