Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jaxrs-dev] Allow multiple HTTP method annotations on the same resource method?

Hi All,

We had an internal customer ask whether it was allowed to use multiple method annotations on the same resource method - for example:

@Path("/somePath")
public class MyResource {

    @POST
    @PUT
    public Response postOrPut(...) {...}
}

I couldn't find anywhere in the spec where this was explicitly allowed or forbidden.  I'd be interested in hearing thoughts on whether this should be allowed or not.  I'm mostly on the fence, but leaning toward not allowing it, but I can see it's usefulness.  In either case, I think it would be good to document it to avoid ambiguity and potential portability issues.

What do you all think?

Thanks,

Andy

Back to the top