myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nebinger, David" <>
Subject RE: Confusion about Tomahawk with Facelets
Date Wed, 27 Jun 2007 17:41:22 GMT
> I just opened HtmlDataTable.class from tomahawk.jar in the 
> decompiler, and this is what I see:
> package org.apache.myfaces.component.html.ext;
> - not "org.apache.myfaces".
> Also on the other thought, if two jars (tomahawk and myfaces) 
> would have the same class (I mean -in the same package) they 
> would conflict.
> So, I'm still wondering, if and how this component class in 
> tomahawk package is called, and why xyzTag class (in 
> tomahawk) is pointing it's
> getComponent() to "org.apache.myfaces".
> Also, I've noticed that DataTable has some more classes 
> (DataTableHack), so I just double-checked with DataScroller 
> and found the same confusion)
> vlad

Okay, that's a different confusion entirely.

First the faces-config.xml file defines the component and renderer types
as, say, org.apache.myfaces.HtmlDataTable.  See the <component-type> and
<renderer-type> elements.  These basically define aliases to the true
class implementations defined via the <component-class> and
<renderer-class> elements.

The tomahawk TLD file defines how the tag (i.e. <t:dataTable /> maps to
the alias values defined in the faces-config.xml.

So, the <t:dataTable> tag is defined as:


When you go to the faces-config.xml file, you see that the component
type is actually defined as:


Which shows that the full class name for the implementation is

Also the renderer is defined as:


Again, it identifies the class that implements the renderer.

In the source files, you'll also see that they return the alias values
defined in the <component-type> and <renderer-type> tags.

It's not meant to be confusing, it is meant to simplify things by
removing actual classpaths in the various files.  The component type and
renderer types are prefixed with "org.apache.myfaces" so the possibility
of naming conflicts; HtmlDataTable as a name could possibly conflict if
the standard JSF elements were so named; by prefixing with
"org.apache.myfaces" you can have your own HtmlDataTable component and
still use the tomahawk components.

Those *Hack classes are internal classes for the implementation; instead
of decompiling the class files themselves, check out the source to see
the embedded comments.  These seem to be classes to provide some
additional visibility over the data model, although I really haven't dug
into it to say anything factual about them.

View raw message