Re: Proposed issue: site metadata hook (slight variation)

Julian Reschke wrote,
> > You've misread the Servlet spec. It _allows_ Servlet
> > implementations to support arbitrary extension HTTP methods, but it
> > doesn't _require_ them to provide support.
>
> The HttpServletRequest object has "getMethod()", wich "returns the
> method with which the request was made". I can't see how this is
> optional. Could you explain that?

It returns the requst method _if_ the request has been accepted by the 
servlet container and passed through to a servlet. There's nothing in 
the spec that requires servlet container to behave that way for 
arbitrary extension methods. A servlet container which responded with a 
501 Unimplemented would be completely within it's rights.

> Anyway, Tomcat (the reference impl) and all other servlet engines
> I've tested actually behave this way.

Sure, and Tomcat also provides WebDAV support. That's great, but it's 
not required by the servlet spec either.

> Yes, it allows. The servlet API gives you all the control you need
> (by implementing the "service(request, response)" method).

Yes, you can implement a service() method to handle arbitrary methods, 
but there's no guarantee that your servlet will ever see them.

Cheers,


Miles

Received on Wednesday, 12 February 2003 10:08:27 UTC