webtier@glassfish.java.net

Re: [webtier] JSF2: Facelet tags vs Composite components

From: Ryan Lubke <Ryan.Lubke_at_Sun.COM>
Date: Tue, 21 Jul 2009 10:45:44 -0700

On 7/21/09 7:13 AM, webtier_at_javadesktop.org wrote:
> Hello,
>
> I've been using JSF and Facelets for about two years and I welcome the improvements that are about to ship with version 2.
>
> In the past few days I've been struggling to make #{cc} work in custom Facelet tags with no success. Now I have started to realize that the new composite components are not the same as the old Facelet tags.
>
> What I like about the new composite components is the cc.attrs map that provides encapsulation of the component attributes. The lack of such scope is problematic with Facelets because they automatically inherit all the available variables.
>
> What I don't like about the composite components is that I can't find a way to specify a custom namespace or custom location for them. I'm building a solid set of components and functions and I can have custom namespace for functions and Facelet tags but I'm forced to use something like "http://java.sun.com/jsf/composite/components" for the composite components.
>
> So my questions are:
>
> 1. Are there any chances that features like #{cc} will be available in custom Facelet tags?
>
What about #{component}? This resolves to the currently processing
component. You can access the attributes map
with expressions such as #{component.attributes['attrName']}.
> 2. Are there any plans to make composite components configurable in terms of namespace and location.
>
The namespace is configurable. For example, if you included the
following taglib.xml (schema information excluded) in your component jar:

<facelet-taglib>
<namespace>http://domain.com/path</namespace>
<composite-library-name>compositeTest</composite-library-name>
</facelet-taglib>

then the compositeTest library would be mapped to http://domain.com/path
(compositeTest is the same name
you'd use in the default composite component uri
http://java.sun.com/jsf/composite/compositeTest)

There are no plans to allow composite components to exist outside of
/resources or META-INF/resources
at this point in time. However, you can provide a custom
ResourceHandler implementation to find resources
in which ever directory you wish.

>
> Thanks!
> [Message sent by forum member 'rostislav' (rostislav)]
>
> http://forums.java.net/jive/thread.jspa?messageID=356762
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: webtier-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: webtier-help_at_glassfish.dev.java.net
>
>