You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by Carsten Ziegeler <cz...@apache.org> on 2009/06/02 19:13:31 UTC

Clarification for ResourceResolver#map

Hi,

how is the ResourceResolver#map method supposed to work or more precisly
what input is expected. The javadoc mentions a resource path as input
parameter.
What is supposed to happen if the path contains a query string or an anchor?

Regards
Carsten
-- 
Carsten Ziegeler
cziegeler@apache.org

Re: Clarification for ResourceResolver#map

Posted by Felix Meschberger <fm...@gmail.com>.
Hi,

Carsten Ziegeler schrieb:
> Felix Meschberger wrote:
>> Hi Carsten
>>
>> Carsten Ziegeler schrieb:
>>> how is the ResourceResolver#map method supposed to work or more precisly
>>> what input is expected. The javadoc mentions a resource path as input
>>> parameter.
>>> What is supposed to happen if the path contains a query string or an anchor?
>> The query string is cut off IIRC before applying the mapping and
>> appended again at the end. 
> Great, I didn't find this in the code. Can you give me a pointer please? :)

Its in the JcrResourceResolver2.map(HttpServletRequest, String) method
where the resource is resolved from the resource path calling
resolveInternal (line 277). This yields the raw path (the path of the
resource) and the part of the path not belonging to the resource.

It seems that here, we should cut off the query and/or anchor *before*
calling the resolveInternal method.

Regards
Felix

> 
> Regards
> Carsten
> 
>> The anchor is not currently handled, which
>> might be considered a bug to be fixed.
>>
>> Actually the resource path may also contain appended selectors and
>> extensions, which are also cut off at the beginning and reappended at
>> the end.
>>
>> Regards
>> Felix
>>
>>
> 
> 

Re: Clarification for ResourceResolver#map

Posted by Carsten Ziegeler <cz...@apache.org>.
Felix Meschberger wrote:
> Hi Carsten
> 
> Carsten Ziegeler schrieb:
>> how is the ResourceResolver#map method supposed to work or more precisly
>> what input is expected. The javadoc mentions a resource path as input
>> parameter.
>> What is supposed to happen if the path contains a query string or an anchor?
> 
> The query string is cut off IIRC before applying the mapping and
> appended again at the end. 
Great, I didn't find this in the code. Can you give me a pointer please? :)

Regards
Carsten

> The anchor is not currently handled, which
> might be considered a bug to be fixed.
> 
> Actually the resource path may also contain appended selectors and
> extensions, which are also cut off at the beginning and reappended at
> the end.
> 
> Regards
> Felix
> 
> 


-- 
Carsten Ziegeler
cziegeler@apache.org

Re: Clarification for ResourceResolver#map

Posted by Felix Meschberger <fm...@gmail.com>.
Hi Carsten

Carsten Ziegeler schrieb:
> how is the ResourceResolver#map method supposed to work or more precisly
> what input is expected. The javadoc mentions a resource path as input
> parameter.
> What is supposed to happen if the path contains a query string or an anchor?

The query string is cut off IIRC before applying the mapping and
appended again at the end. The anchor is not currently handled, which
might be considered a bug to be fixed.

Actually the resource path may also contain appended selectors and
extensions, which are also cut off at the beginning and reappended at
the end.

Regards
Felix