Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
The moose likes JSF and the fly likes my component - my renderer Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "my component - my renderer" Watch "my component - my renderer" New topic

my component - my renderer

Eric Härtel

Joined: Jun 08, 2009
Posts: 8
Hi everybody,

I'm writing my first component, and something with the component renderer relation doesn't work. I use JSF with facelets and started at the taglib.xml with

Thereafter I added the faces-config.xml with the component and the renderer in the renderer-kit

IMHO that should be enough to connect a component to the appropriate renderer. In the server log I found this during serverstartup:

Now the problem, when I try to render my Rect the following error is shown in the server log:

As you see, the render-type is wrong. Does anybody have some sugestion how to connect the component with the renderer.

Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 17410

If the component renders itself, the renderer-type defined in the component should be null. The stock HTML renderer types are tied to specific HTML elements and JSF decided that you're planning on rendering an HTML input text box element.

I'm surprised you got what you did, though, since Facelets puts its own spin on custom tags and their rendering. Which, alas, I've not seen clearly explained.

An IDE is no substitute for an Intelligent Developer.
Eric Härtel

Joined: Jun 08, 2009
Posts: 8
The component should not render itself. There is a component class Rect holding height and width and all that stuff, and there is a class RectRenderer.
Eric Härtel

Joined: Jun 08, 2009
Posts: 8
It is solved. The component class was derived from UIOutput, which returns always renderer type Text.
I agree. Here's the link:
subject: my component - my renderer
It's not a secret anymore!