You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Daniel Niklas <co...@dniklas.de> on 2008/05/16 16:48:22 UTC

[JSF] how to "enable" facelets for my jsf component

Hi,

i can't get my jsf component to work within a facelets environment. I took
the example of Bruno Aranda, a kind of hello world example
(http://brunoaranda.googlepages.com/jsfcomponentsarchetype2).

This works for me with jsps. When i switch to facelets, i get the following
warnings and nothing of my 
component is rendered:

16.05.2008 16:38:58 org.apache.myfaces.renderkit.html.HtmlRenderKitImpl
getRenderer
WARNUNG: Unsupported component-family/renderer-type:
javax.faces.Output/daniel.test.lab.jsf.mycomponents.hello.SayHelloUI
2008-05-16 16:38:58.055:/standard-test-facelets-jsf:INFO:  No Renderer found
for component {Component-Path : [Class:
javax.faces.component.UIViewRoot,ViewId: /example-1.xhtml][Class:
javax.faces.component.html.HtmlForm,Id:
mainForm][Class:daniel.test.lab.jsf.mycomponents.hello.SayHelloUI,Id: _id5]}
(component-family=javax.faces.Output,
renderer-type=daniel.test.lab.jsf.mycomponents.hello.SayHelloUI)

For facelets i added a mycomp.facelets.xml (into META-INF):
<?xml version="1.0"?>
<!DOCTYPE facelet-taglib PUBLIC
  "-//Sun Microsystems, Inc.//DTD Facelet Taglib 1.0//EN"
  "http://java.sun.com/dtd/facelet-taglib_1_0.dtd">

<facelet-taglib>
	<namespace>http://daniel.de/jsfcomponents</namespace>

	<tag>
		<tag-name>sayHello</tag-name>
		<component>
			<component-type>
				daniel.test.lab.jsf.mycomponents.hello.SayHelloUI
			</component-type>
			<renderer-type>
				daniel.test.lab.jsf.mycomponents.hello.SayHelloUI
			</renderer-type>
		</component>
	</tag>
</facelet-taglib>

What's wrong here?

Thanks,
Daniel

 
-- 
View this message in context: http://www.nabble.com/-JSF--how-to-%22enable%22-facelets-for-my-jsf-component-tp17276563p17276563.html
Sent from the MyFaces - Users mailing list archive at Nabble.com.


RE: [JSF] how to "enable" facelets for my jsf component

Posted by Daniel Niklas <co...@dniklas.de>.
Hi David,

sorry, only know it was possible to look at this/my problem, thanks for your
answer.


Nebinger, David wrote:
> 
> You need more than just the facelet-taglib support.  There's integral
> stuff that has to go into the code before it's usable.
> 
> This message indicates that you are not returning a valid component
> and/or renderer type from the component body tag.  The values returned
> from the getRendererType() and getComponentType() methods are used as
> lookups against the faces-config.xml and taglib.xml files in the
> component jar file.
> 

As i mentioned, the "jps-stuff" works already, the component rendering is
correct and no warnings were printed out. My suspicion was, that there is
something wrong with the "facelets-stuff", but sadly I couldn't see this.

My fault was, that i put the component-type to the renderer-type, as well
(in taglib.xml for facelets).
The correct facelets-configuration for my example must be:

	<tag>
		<tag-name>sayHello</tag-name>
		<component>
			<component-type>
				daniel.test.lab.jsf.mycomponents.hello.SayHelloUI
			</component-type>
			<renderer-type>
				daniel.test.lab.jsf.mycomponents.hello.SayHelloRenderer
			</renderer-type>
		</component>
	</tag>


Nebinger, David wrote:
> 
> Bruno's article talks about both of the files and what needs to go into
> them, but it looks like you're still missing some pieces...
> 
> Personally I didn't use archetype for our JSF/Facelets components.  They
> are really simple to hand-code, and (outside of standard method
> overrides) there's not a whole lot of boilerplate code that I can see
> archetype saving you much time on.
> 
> And I still can't get away from the belief that w/o hand coding things
> like this you'll never make heads or tails out of code generated by a
> tool on your behalf...
> 
You're right, this is my opinion, too. But this was the "best" example i
could find. 
I didn't use the archetype etc. Today i found another "check list" at 
http://blogs.steeplesoft.com/jsf-component-writing-check-list/. I think,
this
is quite helpful.

Best regards
Daniel

-- 
View this message in context: http://www.nabble.com/-JSF--how-to-%22enable%22-facelets-for-my-jsf-component-tp17276563p17490085.html
Sent from the MyFaces - Users mailing list archive at Nabble.com.


RE: [JSF] how to "enable" facelets for my jsf component

Posted by "Nebinger, David" <dn...@tbbgl.com>.
> i can't get my jsf component to work within a facelets 
> environment. I took the example of Bruno Aranda, a kind of 
> hello world example 
> (http://brunoaranda.googlepages.com/jsfcomponentsarchetype2).
> 
> This works for me with jsps. When i switch to facelets, i get 
> the following warnings and nothing of my component is rendered:
> 
> 16.05.2008 16:38:58 
> org.apache.myfaces.renderkit.html.HtmlRenderKitImpl
> getRenderer
> WARNUNG: Unsupported component-family/renderer-type:

You need more than just the facelet-taglib support.  There's integral
stuff that has to go into the code before it's usable.

This message indicates that you are not returning a valid component
and/or renderer type from the component body tag.  The values returned
from the getRendererType() and getComponentType() methods are used as
lookups against the faces-config.xml and taglib.xml files in the
component jar file.

Bruno's article talks about both of the files and what needs to go into
them, but it looks like you're still missing some pieces...

Personally I didn't use archetype for our JSF/Facelets components.  They
are really simple to hand-code, and (outside of standard method
overrides) there's not a whole lot of boilerplate code that I can see
archetype saving you much time on.

And I still can't get away from the belief that w/o hand coding things
like this you'll never make heads or tails out of code generated by a
tool on your behalf...