On Fri, Jul 31, 2009 at 11:06 AM, Vidar Ramdal<[email protected]> wrote:
> No, I used only the old-fashioned Javadoc method, but should that make
> a difference?

You are right, it should not make a difference, but the bug could only
be in the QDox based way. With QDox, the properties are read from the
java sources at build time and are put into the
OSGI-INF/serviceComponents.xml file inside the bundle, which will be
picked up by SCR when it is installed. With Java annotations the
interpretation of the SCR annotation is done whenever the class is
loaded (IIUC), so it's slightly different (and allows for any loaded
class to be a service, eg. also ones where the source is in the JCR).

> 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.
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.

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)?

See SLING-892 [1] for the enhancement request to support extensions
for all methods.

[1] https://issues.apache.org/jira/browse/SLING-892

Regards,
Alex

-- 
Alexander Klimetschek
[email protected]

Reply via email to