2009/7/31 Alexander Klimetschek <[email protected]>:
> On Fri, Jul 31, 2009 at 11:06 AM, Vidar Ramdal<[email protected]> wrote:

>> Also, I see that if I drop the "sling.servlet.extensions" property,
>> the servlet seems to be registered as expected:
>> * @scr.property name="sling.servlet.extensions" value="html"
>> * @scr.property name="sling.servlet.resourceTypes" 
>> value="sling/servlet/default"
>
> I guess you mean if you drop the "sling.servlet.methods" property.

Yes, you're right. Sorry :)

> That makes sense, as it then would be registered for GET only and
> that's the only method for which extensions are currently supported
> (well, also HEAD afaik).

>> But with "sling.servlet.extensions" set to the array of GET and POST,
>> the servlet responds to requests without the extension:
>> * @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"
>>
>> This seems like a bug to me. I'll file a JIRA for it, if nobody
>> believes behavior this is intentional.
>
> No, extensions should be supported for all methods (because I think
> that is more intuitive), but currently they are only supported for
> GET.

Agree.

> What happens if you only set GET on sling.servlet.methods? It might be
> the case that the extension is completely ignored for all methods if
> you specify sling.servlet.methods with GET *and* POST. Or did you only
> see extensions being ignored for POST (which would be as expected)?

Even with only GET, the servlet responds to all extensions.

So now I register the servlet with:
 * @scr.property name="sling.servlet.extensions" value="html"
 * @scr.property name="sling.servlet.resourceTypes"
value="sling/servlet/default"
 * @scr.property name="sling.servlet.methods" value="GET"

But still, the servlet responds to requests where I believe it
shouldn't, e.g. GET /node.json.
When I disable the rogue servlet, /node.json returns the expected JSON
rendering.

I'll file a JIRA for this for now, and debug it more over the weekend.

-- 
Vidar S. Ramdal <[email protected]> - http://www.idium.no
Akersgata 16, N-0158 Oslo, Norway
+47 21 531941, ext 2070

Reply via email to