CXF
  1. CXF
  2. CXF-4224

Custom HTTP methods (HttpMethod annot) not supported?

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Cannot Reproduce
    • Affects Version/s: 2.5.3
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Estimated Complexity:
      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

        Activity

          People

          • Assignee:
            Sergey Beryozkin
            Reporter:
            Jakub Bocheński
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development