Uploaded image for project: 'CXF'
  1. CXF
  2. CXF-4224

Custom HTTP methods (HttpMethod annot) not supported?

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Cannot Reproduce
    • 2.5.3
    • None
    • None
    • None
    • Unknown

    Description

      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

      Attachments

        Activity

          People

            sergey_beryozkin Sergey Beryozkin
            jboch Jakub Bocheński
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: