There was a discussion about nested resource library names last year. I
would say to search the archives, but I don't know if that's possible.
Anyway, here was the outcome:
Ed:
Yes, you are correct that the resource naming scheme prevents nested
resource libraries. Nested resource libraries were not on the list of
requirements when we designed this feature back in November of 2007. We
will not accept this requirement change at this point.
Dan:
So the spec needs to at least be clear that it's not permitted and suggest
the alternative. Several people reading it didn't understand what to do in
this case.
IMHO, it's a shame that we can't use the nested structure. Seems like a
pretty obvious convention instead of configuration thing. I don't know how
that got missed in the design process.
---
Kito D. Mann | twitter: kito99 | Author, JSF in Action
Virtua, Inc. |
http://www.virtua.com | JSF/Java EE training and consulting
http://www.JSFCentral.com - JavaServer Faces FAQ, news, and info | twitter:
jsfcentral
+1 203-404-4848 x3
Sign up for the JSFCentral newsletter:
http://oi.vresp.com/?fid=ac048d0e17
On Sat, Jan 30, 2010 at 6:23 PM, Cay Horstmann <cay(a)horstmann.com> wrote:
> I have been trying to understand whether the spec allows slashes in
> resource library names. For example, is it within the spec to have a
> composite component with library name components/util?
> It works fine in Mojarra: Place components into
resources/components/util
> and use a namespace alias
>
xmlns:util="http://java.sun.com/jsf/composite/components/util
> But there is a catch--it won't locate a backing
component in the
> components.util package.
> And per the API docs for Application#createComponent, I
have no right to
> expect that: "Create a fully qualified Java class name by removing any file
> extension from resource-name and let fqcn be library-name + "." +
> resource-name".
> So, I tried to read the spec for clarification. 3.6.1.4
states: The
> occurrence of the string “http://java.sun.com/jsf/composite/” in a Facelet
> XML namespace declaration means that *whatever follows that last “/”* is
> taken to be the name of a resource library.
> "Whatever follows" is pretty clear. In my
example, components/util would be
> the library name. But is it a legal library name?
> 2.6.1.3 states "Every character in a resource
identifier must be a valid
> character suitable for use in a string passed to the constructor
> of java.io.File that takes a single String argument."
> I don't understand this statement. In Windows, can you
make files
> containing / symbols? If so, will slashes be treated as directory
> separators? What about colons? Will they be drive letters?
> Or are we saying it doesn't matter--we just feed the
library name into the
> File constructor, and whatever happens, happens? Then you could have a
> situation where a WAR file works fine on Linux but not on Windows.
> Before I file an issue, could one of you tell me whether
you intended to
> support hierarchical library names (such as components/util), or whether you
> envisioned only one level?
> Thanks,
> Cay
> --
> Cay S. Horstmann |
http://horstmann.com |
mailto:cay@horstmann.com