users@javaserverfaces-spec-public.java.net

[jsr344-experts mirror] [jsr344-experts] Re: [jsr-344-experts] Clarification about JAVASERVERFACES_SPEC_PUBLIC-1141 Specify that all parts of a resource identifier must not have "/".

From: Edward Burns <edward.burns_at_oracle.com>
Date: Mon, 5 Nov 2012 10:54:42 -0800

>>>>> On Sat, 3 Nov 2012 12:54:35 -0500, Leonardo Uribe <lu4242_at_gmail.com> said:

LU> In few words, the problem is people already relies on the fact that
LU> resourceName allow slashes and take advantage of that. So, if
LU> resourceName is restricted to do not allow slashes, it will break
LU> code that works on JSF 2.0/2.1 .

LU> My question is simple: which is the benefit of this change? Isn't
LU> this make things harder? After all, it is very useful to have a
LU> tree structure to organize files inside a library, right? I know
LU> originally, allow slashes was not intended, but I think in this case
LU> we have to take a look at how users really use JSF 2.0 stuff. For
LU> example, see this link:

LU> http://www.mkyong.com/jsf2/resources-library-in-jsf-2-0/

LU> Obviously, the problem resides on the fact that a resource can be
LU> located using two different syntax.
LU> For example, if a resource is located in
LU> META-INF/resources/default/css/mystyles.css, you can retrieve it
LU> using:

LU> <h:outputStylesheet library="default" name="css/mystyles.css"/>

LU> or

LU> <h:outputStylesheet name="default/css/mystyles.css"/>

LU> Both generated request paths are different but the served resource
LU> is the same.

Thank you for being the voice of the users here. I don't want to do
anything that breaks behavior on which people depend. I have re-opened
JAVASERVERFACES_SPEC_PUBLIC-1141 and the impl issue which depends on it.

We *do* need to say *something* about the usage you cite above, and it
comes down to what do we say about something like:

resourceHandler.createResource("css/images/background.png")

Leonardo, do you think it is sufficient to modify the javadoc for *just*
ResourceHandler.createResource(String) to say that if the argument
contains more than one slash, the text between the beginning of the
string and that first slash must be taken as the libraryName, and the
remainder must be used to find the resourceName?

Thanks,


Ed

-- 
| edward.burns_at_oracle.com | office: +1 407 458 0017
| homepage:               | http://ridingthecrest.com/