As Glen said, the framework will throw WebApplicationExceptions with the 405
status in case of no resource method matching a given HTTP verb has been
found, I only proposed to catch these exceptions with a custom exception
mapper if you'd like to customize the error response, ex, change the error
status or add some response message, etc...

Sergey

On Thu, Jan 20, 2011 at 6:27 PM, Glen Mazza <[email protected]> wrote:

> I think you should just remove those unused methods, and let the framework
> return whatever JAX-RS defined exceptions that occur when a client makes a
> call using such unsupported HTTP actions.  Talend has several new
> JAX-RS/REST examples[1] (I'd look at the intro and advanced jaxrs samples)
> that can give you other architectural ideas.
>
> Glen
>
> [1] http://www.jroller.com/gmazza/date/20101222
>
> On 20.01.2011 13:01, Eric MacAdie wrote:
>
>> I have a few web services using the CXF REST API. For each I really only
>> take an action for the @GET and @POST commands. I do have methods for the
>> @PUT, @DELETE and @HEAD actions, but all I do is return a message saying
>> that I do not really handle those methods. Is there a default annotation
>> for
>> all the HTTP methods that would catch whatever I am not using?
>>
>> Regards,
>> Eric MacAdie
>>
>
>
> --
> Glen Mazza
> Software Engineer, Talend (http://www.talend.com)
> blog: http://www.jroller.com/gmazza
>
>
>

Reply via email to