users@jersey.java.net

default method?

From: Zoltan Arnold NAGY <Zoltan.Nagy_at_Sun.COM>
Date: Sat, 31 Oct 2009 23:55:53 +0100

Hi,

By accident I forgot to add @GET to a method. This is the only method in
a resource
class (annotated with @Path("/x")).

Interestingly, when I did a GET on the method's url, logging showed it
did get called, but
it's return value (which was a Response) got discarded, and on the
client I got a 405
(Method Not Allowed).

Isn't this a bit inconsistent? Either not running the method, or not
discarding
the return value from it would be better.

(I did have a quick look at the 1.0 spec, and 3.3 sais that a resource
method
must have a method annotation, and does not say a word if a default method
annotation exists, so in my read the 405 was correct behaviour, but the
method
itself should not have been called).

Thanks,
Zoltan