Re: PUT and DELETE tunneling

From: Dhanji R. Prasanna <>
Date: Mon, 9 Jul 2007 20:23:11 +1000

On 4/27/07, Marc Hadley <> wrote:
> On Apr 26, 2007, at 12:36 PM, Stefan Tilkov wrote:
> > Assuming my resource class is implemented "cleanly", i.e. it has
> > post, put, delete and get methods (that map appropriately), this
> > would mean I'd have to add another post method (like the one below)
> > that calls delete(), and I'd have to do that for every resource.
> > But in general, I will make the decision to use this workaround for
> > my complete web app, not for each and every resource class. Can
> > this be done in a generic way?
> >
> > I'm not at all sure I like this, but how about this, inspired by [1]:
> >
> > @HttpMethod(DELETE) @HttpMethodOverride("X-HTTP-Method-Override",
> > PUT) void delete() {...}
> >
> In a servlet container you could just write a servlet filter to patch
> the request method based on, e.g., the X-HTTP-Method-Override header.

At somewhat of a tangent...
Do we want to have some kind of generic interception at the API level for
Requests and Responses? I.e. independent from the deployment environment?
For example, a JAX-RS filter. If we're providing container managed resources
(with scoping to request and singleton), interception would be an important
use case.