webtier@glassfish.java.net

JSF2 composite component not working

From: <webtier_at_javadesktop.org>
Date: Fri, 16 Apr 2010 09:42:46 PDT

I'm trying to create a composite component for use in my application, and I'm running into problems with the simplest "hello, world" component. (Using Mojarra 2.0.1 FCS b02)
<br/>
I have placed a file named hello.xhtml in {jboss deploy}/application.ear/application.war/resources/greet :
<br/>
<html xmlns="http://www.w3.org/1999/xhtml"
  xmlns:h="http://java.sun.com/jsf/html"
  xmlns:composite="http://java.sun.com/jsf/composite">

<composite:interface>
    <composite:attribute name="who"/>
</composite:interface>
<composite:implementation>
    <h:outputText value="Hello, #{cc.attrs.who}!"/>
</composite:implementation>
</html>

Now in home.xhtml, located at the root of my webapp ({jboss deploy}/application.ear/application.war/home.xhtml):

<!DOCTYPE html 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:ui="http://java.sun.com/jsf/facelets"
            xmlns:h="http://java.sun.com/jsf/html"
            xmlns:f="http://java.sun.com/jsf/core"
            xmlns:greet="http://java.sun.com/jsf/composite/greet"
            xmlns:s="http://jboss.com/products/seam/taglib"
            template="layout/template.xhtml">
    <ui:define name="content">
    <div id="content">
        <greet:hello who="World"/>
        <br/>
    </div>
    </ui:define>
</ui:composition>
<br/>
But my "hello, world" is not displayed, and I dont get any error messages, even when I turn on debug level logging for com.sun and javax.faces categories.
<br/>
Looking at the rendered page source I see my empty tag:
<br/>
<greet:hello who="world"></greet:hello>
<br/>
I've verified that the resources directory is in the proper place, since adding the directory resources/images/test.jpg, then adding this to home.xhtml:
<br/>
<h:graphicImage value="#{resource['images:test.jpg']}"/>
<br/>
Results in the image being displayed. I just don't know why JSF isn't picking up my xhtml file from the greet directory.
<br/>
Any ideas?

<br/>
<br/>
<br/><br/><br/>
(BTW, is there really no code formatting? or paragraph spacing without br's? Its not my intention to make this post look terrible!)
[Message sent by forum member 'rnideffer']

http://forums.java.net/jive/thread.jspa?messageID=397426