[prev in list] [next in list] [prev in thread] [next in thread] 

List:       wink-dev
Subject:    [jira] Created: (WINK-251) Handling http error 405 correctly
From:       "Lior Harel (JIRA)" <jira () apache ! org>
Date:       2010-01-28 13:55:34
Message-ID: 636634987.105541264686934655.JavaMail.jira () brutus ! apache ! org
[Download RAW message or body]

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


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.
-
You can reply to this email to add a comment to the issue online.


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic