dev@glassfish.java.net

Re: HTTP DELETE

From: Jan Luehe <Jan.Luehe_at_Sun.COM>
Date: Fri, 21 Jul 2006 10:27:05 -0700

Sameer Tyagi wrote:

> Are HTTP DELETE operations disabled for WAR files by default in G/F ?

If your servlet extends javax.servlet.http.HttpServlet, it'll be
sufficient to override doDelete().

If you look at javax.servlet.http.HttpServlet, you'll notice that the
default impl of service() already correctly dispatches the various
supported HTTP methods to the corresponding doXXX() servlet methods,
meaning a DELETE request is forwarded to the servlet's doDelete()
method.

The default impl of this method in javax.servlet.http.HttpServlet is to
return
a METHOD_NOT_ALLOWED (405) or BAD_REQUEST (400) error, depending
on the HTTP protocol version.

If you want this method to do anything useful, you need to override it
in your servlet impl.

See Jeanfrancois' reply for the security considerations you will need to
consider.


Jan