You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@wink.apache.org by "Gerhard Petracek (JIRA)" <ji...@apache.org> on 2013/07/13 22:13:55 UTC

[jira] [Closed] (WINK-251) Handling http error 405 correctly

     [ https://issues.apache.org/jira/browse/WINK-251?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gerhard Petracek closed WINK-251.
---------------------------------

    
> Handling http error 405 correctly 
> ----------------------------------
>
>                 Key: WINK-251
>                 URL: https://issues.apache.org/jira/browse/WINK-251
>             Project: Wink
>          Issue Type: Bug
>          Components: Common
>            Reporter: Lior Harel
>            Assignee: Bryant Luk
>             Fix For: 1.1
>
>
> I am having troubles handling wrong method calls. When calling a resource with an inappropriate method (e.g. POST instead of GET), wink identifies the resource doesn't support the requested method, and generates a WebApplicationException with status code 405. (so far so good :-) )
> For some reason the http error code 405 is not part of the Status class (enum), so calling valueOf doesn't generate the appropriate Status object instance. I guess that's not a wink issue, as it is not part of the javax.ws.rs spec either.
>  The HTP spec says that when returning 405 error, the server also MUST set the Allow header. 
> http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.6
> But the problem is setting the Allow header, when I handle the exception in my custom ExceptionMapper class, and the exception has 405 status, I can't easily tell what are the allowed methods for the requested resource.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira