users@jersey.java.net

RE: [Jersey] Re: Re: Re[Jersey] ading entity body

From: Robertson, Jeff <jeff.robertson_at_digitalinsight.com>
Date: Thu, 23 Oct 2008 15:26:28 -0400

Should I be able to declare an annotation like this:

@Target(value=METHOD)
@Retention(value=RUNTIME)
@HttpMethod("PATCH")
public @interface PATCH {
}

And start putting it on resource methods, just like @GET and @PUT? Or
does something in Jersey's internals need to change to support the
addition of new HTTP methods?


-----Original Message-----
From: Paul.Sandoz_at_Sun.COM [mailto:Paul.Sandoz_at_Sun.COM]
Sent: Thursday, October 23, 2008 11:52 AM
To: users_at_jersey.dev.java.net
Subject: Re: [Jersey] Re: Re: Re[Jersey] ading entity body


On Oct 23, 2008, at 5:24 PM, Gili wrote:

>
>
> Paul Sandoz wrote:
>>
>>> Actually I was going to use PUT for both partial and full updates.
>>>
>>
>> That would be against the semantics of PUT.
>>
>
> According to who or what?

http://greenbytes.de/tech/webdav/rfc2616.html#PUT

Which is why the following draft has been created:

http://greenbytes.de/tech/webdav/draft-dusseault-http-patch-11.html

"A new method is necessary to improve interoperability and prevent
errors. The PUT method is already defined to overwrite a resource with
a complete new body, and can not be reused to do partial changes.
Otherwise, proxies and caches and even clients and servers may get
confused as to the result of the operation."


> "RESTful Web Services" page 300 reads "If the
> resource already exists, parse the representation and turn it into a
> series
> of changes to the state of this resource. If the changes would leave
> the
> resource in an incomplete or inconsistent state, send a response
> code of 400
> ("Bad Request")."
>
> I interpret this as meaning that PUT can be used for partial updates.
>

I think it is describing what a server-side implementation would do to
process the request entity body and detect errors related to an
incompatibility.

Paul.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
For additional commands, e-mail: users-help_at_jersey.dev.java.net