You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Jakub Bocheński (Issue Comment Edited JIRA)" <ji...@apache.org> on 2012/04/04 14:39:24 UTC

[jira] [Issue Comment Edited] (CXF-4224) Custom HTTP methods (HttpMethod annot) not supported?

    [ https://issues.apache.org/jira/browse/CXF-4224?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13246206#comment-13246206 ] 

Jakub Bocheński edited comment on CXF-4224 at 4/4/12 12:38 PM:
---------------------------------------------------------------

If I understand you correctly then my example clearly shows they can be diferent.

I think what I've done is valid acording to the jax-rs spec.
OTOH I have no idea where the assumtion that annotation [class-]name must much the HttpMethods argument came from.

                
      was (Author: jboch):
    If I understand you correctly then my example clearly shows they can be diferent.

I think what I've valid acording to the jax-rs spec.
OTOH I have no idea where the assumtion that annotation [class-]name must much the HttpMethods argument came from.

                  
> Custom HTTP methods (HttpMethod annot) not supported?
> -----------------------------------------------------
>
>                 Key: CXF-4224
>                 URL: https://issues.apache.org/jira/browse/CXF-4224
>             Project: CXF
>          Issue Type: Bug
>    Affects Versions: 2.5.3
>            Reporter: Jakub Bocheński
>
> I wanted to save myself some typing and introduce a custom method annotation for use with a response handler:
> @Target(value = METHOD)
> @Retention(value = RUNTIME)
> @HttpMethod(value = POST)
> public @interface POST_create {
> }
> since HATEOS resource creation is done with POST.
> However a method:
> @POST_create 
> @Consumes(CONTENT_FORM_URLENCODED)
> @Description(title = "Factory method")
> Dto createSomething( ... );
> is not found as valid resource method.
> When I annotate it with regular POST annot. it works:
> @POST
> @POST_create 
> @Consumes(CONTENT_FORM_URLENCODED)
> @Description(title = "Factory method")
> Dto createSomething( ... );
> BTW. While trying to debug this I noticed that the HttpMethod annotation is still recognized as a valid resource method annotation ( c.f. CXF-1007 ) in org.apache.cxf.jaxrs.utils.AnnotationUtils.initMethodAnnotationClasses() line 114

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira