One or more resources have the target of 'head', but no 'head' component has been defined within the view.
lastcow Jul 30, 2012 10:38 AMI having following strange problem with Seam web project, I tried google the answers, but nothing helpful:(.
22:20:43,199 INFO [javax.enterprise.resource.webcontainer.jsf.renderkit] (http-localhost-127.0.0.1-8080-1) WARNING: FacesMessage(s) have been enqueued, but may not have been displayed.
sourceId=null[severity=(ERROR 2), summary=(One or more resources have the target of 'head', but no 'head' component has been defined within the view.), detail=(One or more resources have the target of 'head', but no 'head' component has been defined within the view.)]
This is project generated using JBoss tools (Seams 2.3.0 Beta 2, JSF 2.0, JBoss AS 7.1.1), with latest version of JBoss Developer Studio, Version: 5.0.1.GA, and I didn't change anything.
here are some code:
template.xhtml:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <f:view xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:a="http://richfaces.org/a4j" xmlns:s="http://jboss.com/products/seam/taglib" contentType="text/html"> <h:html> <h:head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> <title>ALl About Knowledge</title> <link rel="shortcut icon" href="#{request.contextPath}/favicon.ico"/> <h:outputStylesheet name="/stylesheet/theme.ecss"/> <h:outputStylesheet name="/stylesheet/theme.css"/> <ui:insert name="head"/> </h:head> <h:body> <ui:include src="menu.xhtml"> <ui:param name="projectName" value="allaboutknowledge"/> </ui:include> <div class="body"> <h:messages id="messages" globalOnly="true" styleClass="message" errorClass="errormsg" infoClass="infomsg" warnClass="warnmsg" rendered="#{showGlobalMessages != 'false'}"/> <ui:insert name="body"/> </div> <div class="footer"> <p>Powered by <a href="http://seamframework.org">Seam</a> #{org.jboss.seam.version} and <a href="http://www.jboss.org/richfaces">RichFaces</a>. Generated by seam-gen.</p> <s:fragment rendered="#{init.debug}"> <a:log hotkey="D"/> <p style="margin-top: -0.5em;"> Conversation: id = #{conversation.id}, #{conversation.longRunning ? 'long running' : 'temporary'}#{conversation.nested ? ', nested, parent id = '.concat(conversation.parentId) : ''} #{' - '} Ajax4jsf Log (Ctrl+Shift+D) #{' - '} <s:link id="debugConsole" view="/debug.xhtml" value="Debug console" target="debugConsole"/> #{' - '} <s:link id="resetSession" view="/home.xhtml" action="#{org.jboss.seam.web.session.invalidate}" propagation="none" value="Terminate session"/> </p> </s:fragment> </div> </h:body> </h:html> </f:view>
home.xhtml:
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:s="http://jboss.com/products/seam/taglib" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:rich="http://richfaces.org/rich" template="layout/template.xhtml"> <ui:define name="head"> </ui:define> <ui:define name="body"> <h1>Welcome to Seam!</h1> <rich:panel> <h:panelGrid columns="2"> <h:graphicImage value="/img/seamlogo.png" alt="Seam logo"/> <s:div styleClass="info"> <p><strong>Your seam-gen project is deployed!</strong> Here are some of the features this project provides:</p> <ul class="bullets"> <li>Ant build script</li> <li>Deployment to JBoss AS (EAR or WAR)</li> <li>Development and production profiles</li> <li>Integration testing using TestNG and Embedded JBoss</li> <li>JavaBean or EJB 3.0 Seam components</li> <li>JPA entity classes</li> <li>A configurable DataSource and JPA EntityManager</li> <li>Templated Facelets views</li> <li>RichFaces panels and tables</li> <li>Default CSS stylesheet</li> <li>Internationalization support</li> </ul> </s:div> </h:panelGrid> </rich:panel> </ui:define> </ui:composition>
Anyone please help, I have been struck here for a week. .
Thanks very much.