dev@jsftemplating.java.net

Re: JSFTemplating: questions on component factories and components

From: Ken Paulsen <Ken.Paulsen_at_Sun.COM>
Date: Wed, 28 Nov 2007 09:04:22 -0800

Hi Mike!

JSF promotes 3rd parties to create components. The Woodstock project
(https://woodstock.dev.java.net) has created an extensive set of JSF
components. The component factory you mentioned is creating one of the
Woodstock components... I can tell b/c the "com.sun.webui.jsf" package
is Woodstock's package name. So, to find the configuration of that
component (and the component itself), you'll need to look in the
Woodstock jar file (or source code). The jar file is named
"webui-jsf.jar" and inside that jar file you'll find
"META-INF/faces-config.xml". That is the faces-config.xml file you are
looking for... inside it you'll fine both a "<component>" and a
"<renderer>" definition related to this component. This should point
you to the Java class files for each of these 2 parts of a component.

Last question (is "com.sun.webui.jsf" a package)... yes, but only by
coincidence (actually by Woodstock's development pattern). The
"component type" String does NOT need to be a package, it is just an
arbitrary String that must be unique. Using the package name (or some
similar prefix) is a good way to ensure some other component library
isn't using the same component type string.

Thanks,

Ken


Michael Phoenix wrote:
> I'm still working on trying to get an understanding of JSGT
> architecture and am having a little problem understanding the
> component factory code and finding the code for the individual
> components.
> Specifically I was looking into the code for TextFieldFactory. The
> comments and last statement in the class prompted some questions that
> I am having problems getting a handle on.
>
> /**
> * <p> The <code>UIComponent</code> type that must be registered in the
> * <code>faces-config.xml</code> file mapping to the UIComponent class
>
> * to use for this <code>UIComponent</code>.</p>
> */
> public static final String COMPONENT_TYPE = "com.sun.webui.jsf.TextField";
> }
>
> 1. Where is the faces-config.xml
> located? I can't find any such xml file in the jsft project or the demo project.
>
> 2. Where do I find the code for the component itself, in this case TextField? It's not in the j2ee javadocs.
>
> 3. Is com.sun.webui.jsf
> a package?
>