2009/8/4 Vidar Ramdal <[email protected]>:
> 2009/7/30 Vidar Ramdal <[email protected]>:
>> What is the intended behavior for a servlet that is registered as follows:
>>  * @scr.property name="sling.servlet.extensions" value="html"
>>  * @scr.property name="sling.servlet.resourceTypes"
>> value="sling/servlet/default"
>>  * @scr.property name="sling.servlet.methods" values.0="GET" values.1="POST"
>>
>> It seems that "sling.servlet.extensions" is ignored, so that this
>> servlet will respond to any extension, if there is no better match.
>> From the docs [1] and [2] it is a little unclear what is supposed to
>> happen, so it might not be a bug, but it still seems strange.
>
> OK, here's what happens:
> When the servlet is picked up by
> o.a.s.servlets.resolver.internal.resource.ServletResourceProviderFactory,
> it is registered under two paths:
> /apps/sling/servlet/default/GET.servlet and
> /apps/sling/servlet/default/html.servlet.
>
> This is because the for loop in the addByType method (line 274), which
> loops over selectors first. It then adds paths for each extension and
> each method.
>
> This does not seem intuitive to me, I would expect the servlet to be
> registered as something like
> /apps/sling/servlet/default/GET.html.servlet (or just
> /apps/sling/servlet/default/html.servlet, since GET is somewhat
> implied).
> But I'm not sure. Can we have a ruling, please?

Btw, this looks exactly like the symptoms described in SLING-512 [1],
which is marked fixed.


[1] https://issues.apache.org/jira/browse/SLING-512
-- 
Vidar S. Ramdal <[email protected]> - http://www.idium.no
Akersgata 16, N-0158 Oslo, Norway
+47 21 531941, ext 2070

Reply via email to