Hi all,

Servlets registered as OSGi services are taken up by the Sling Servlet
Resolver to use them for request processing. To this avail a number of
service registration properties have been defined which are considered
for that registration.

One such property is the sling.servlet.methods property which takes a
list of request method names for which the servlet is registered. It is
currently allowed to omit this property, which causes the servlet to be
registered with no specific method. This allows the servlet to be used
as a fallback if no other servlet applies. An example of this mechanism
is the SlingWebDavServlet.

This mechanism - no property meaning "all" methods" - has its drawbacks
and is counter-intuitive for the developers used to sensitive defaults.
In particular just leaving out a property intending to say "just
everything" is probable not good, either.

So I propose to change the sling.servlet.methods property handling as
follows:

    * If the property is empty or missing, the property is
      assumed to be set to [ "GET", "HEAD" ]

    * If the property is set to the single value "*", the
      servlet is not registered for a specific method.

    * Otherwise the servlet is registered for the configured
      methods names.

WDYT ?

Regards
Felix

Reply via email to