On 10/14/07, Felix Meschberger <[EMAIL PROTECTED]> wrote:

> ...the current
> SlingServlet API pretty much limits the HTTP methods supported, which
> IMHO is not really a good idea. Rather the ScriptHandler should just
> have a single service method which is called with the request, response
> and resolved resource....

What I like about the doGet, doPost, doPut, etc.. methods in the
current microsling SlingServlet interface is that they help people
think in terms of HTTP methods.

Multiple methods might also allow us to standardize the way POST is
overridden - current browser force us to override POST in some
situations (to use it as a PUT or DELETE), and usually people come up
with their own (possibly weird) schemes for this.

We could for example define that adding a "slingMethod=PUT" parameter
to the request causes SlingServlet.doPut to be called instead of
doPost.

To handle additional HTTP methods, we can always keep the service()
method, maybe renamed to doOtherHttpMethod(), and call it for HTTP
methods which are not covered by the SlingServlet's doX() methods.

Also, many servlets just want to handle GET or HEAD (for rendering
content), I think having separate doGet/doHead methods makes this very
clear in the code, which is another plus for the multiple doX()
methods.

WDYT?

Reply via email to