[ https://issues.apache.org/jira/browse/SLING-3319?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Olaf Otto updated SLING-3319: ----------------------------- Description: In order to find and sort ResourceProviders, the ResourceProviderEntry class from org.apache.sling.resourceprovider splits the request path into segments, subsequently traversing the segments to find provides with a root matching the entire path up to the current segment. However, The function split(String) of ResourceProviderEntry splits by "/", thus resulting in the last segment containing any selectors and extensions of the current path, like so: /content/test/root.html -> [content, test, root.html]. Thus a provider with a root path of /content/test/root is not found. The next iteration in ResourceResolver# resolveInternal(String absPath) will then provide /content/test/root to the ResourceProviderEntry. The provider is thus found, but invoked with /content/test/root (without any extensions or selectors). However when requesting a child resource: /content/test/root.html -> [content, test, root, child.html] the provider for root is found and thus invoked with /content/test/root/child.html , i.e. including any selectors and suffixes. In essence, a ResourceProvider can not utilize any selectors or extensions to parametrize the resolution of its root resource. was: In order to find and sort ResourceProviders, the ResourceProviderEntry class from org.apache.sling.resourceprovider splits the request path into segments, subsequently traversing the segments to find provides with a root matching the entire path up to the current segment. However, The function split(String) of ResourceProviderEntry splits by "/", thus resulting in the last segment containing any selectors and extensions of the current path, like so: /content/test/root.html -> [content, test, root.html]. Consequently, a provider with the root path /content/test/root is not found, but when a child of that path is requested, the provider is found. > ResourceProvider does not receive selectors or extensions when root path is > resolved. > ------------------------------------------------------------------------------------- > > Key: SLING-3319 > URL: https://issues.apache.org/jira/browse/SLING-3319 > Project: Sling > Issue Type: Bug > Components: JCR > Affects Versions: Resource Resolver 1.0.6 > Reporter: Olaf Otto > Original Estimate: 4h > Remaining Estimate: 4h > > In order to find and sort ResourceProviders, the ResourceProviderEntry class > from org.apache.sling.resourceprovider splits the request path into segments, > subsequently traversing the segments to find provides with a root matching > the entire path up to the current segment. However, The function > split(String) of ResourceProviderEntry splits by "/", thus resulting in the > last segment containing any selectors and extensions of the current path, > like so: > /content/test/root.html -> [content, test, root.html]. > Thus a provider with a root path of /content/test/root is not found. The next > iteration in ResourceResolver# resolveInternal(String absPath) will then > provide /content/test/root to the ResourceProviderEntry. The provider is thus > found, but invoked with /content/test/root (without any extensions or > selectors). > However when requesting a child resource: > /content/test/root.html -> [content, test, root, child.html] > the provider for root is found and thus invoked with > /content/test/root/child.html , i.e. including any selectors and suffixes. > In essence, a ResourceProvider can not utilize any selectors or extensions to > parametrize the resolution of its root resource. -- This message was sent by Atlassian JIRA (v6.1.5#6160)