users@javaserverfaces-spec-public.java.net

[jsr344-experts mirror] [jsr344-experts] Re: [719-ViewIdToResourcePath] Suggestion: Use ResourceHandler

From: Jakob Korherr <jakob.korherr_at_gmail.com>
Date: Thu, 8 Mar 2012 13:01:17 +0100

Hi Ed,

> Is it ok to explicitly state that '/' is not valid in a localePrefix,
> libraryName, libraryVersion, resourceName, or resourceVersion?

That's true for everything except resourceName. You really need to
allow '/' in the resourceName, because otherwise it won't be possible
to build a directory structure of resources that have more than one
layer.

For example, the following would not be possible anymore:
/resources/jquery/css/style.css
In that case libraryName would be "jquery" and resourceName would be
"css/style.css".

However, for real relative paths between resources (every information
needs to be in the URL-path and not in request parameters), everything
except resourceName needs to adhere to the restriction that a '/' is
not allowed.

Summary:
- disallow '/' for localePrefix, libraryName, libraryVersion, resourceVersion
- allow '/' for resourceName

Regards,
Jakob

Am 7. März 2012 21:38 schrieb Edward Burns <edward.burns_at_oracle.com>:
>>>>>> On Thu, 1 Mar 2012 11:40:04 -0800, Edward Burns <edward.burns_at_oracle.com> said:
>
>>>>>> On Thu, 1 Mar 2012 13:21:11 -0500, Neil Griffin <neil.griffin_at_portletfaces.org> said:
> NG> However this would have small impact to the Portlet Bridge spec. It
> NG> has a feature where the developer can pass a path-mapped view path
> NG> with a request parameter, and the bridge is supposed to check all
> NG> the servlet mappings and then verify the existence of the resource
> NG> by calling ExternalContext.getResource(String). I suppose it could
> NG> call the ResourceHandler instead.
>
> EB> In fact, one of the reasons 719 and 809 was filed was that
> EB> ExternalContext.getResource() was overloaded.  So it's appropriate that
> EB> the new way be consulted.
>
> I have implemented in Mojarra the transition to use ResourceHandler to
> load Facelets instead of ResourceResolver.  But I came across an
> automated test that had "/" in the resourceName.  I thought we had
> forbidden that character from being used in resourceName, but spec
> 2.6.1.3 says:
>
> * There must be a '/' between adjacent segments in a
>  <resourceIdentifier>.
>
> Practically speaking this is a prohibition on using '/' in a
> resourceName.  The first bullet in 2.6.1.3 also mentions excluding the
> path separator character. I want to be explicit about it.
>
> Is it ok to explicitly state that '/' is not valid in a localePrefix,
> libraryName, libraryVersion, resourceName, or resourceVersion?
>
> If so, I'll have to fix this broken test.
>
> Ed
>
> --
> | edward.burns_at_oracle.com | office: +1 407 458 0017
> | homepage:               | http://ridingthecrest.com/



-- 
Jakob Korherr
blog: http://www.jakobk.com
twitter: http://twitter.com/jakobkorherr
work: http://www.irian.at