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

JAX-RS runtime needs to exclude matching sub-resources by default if matching resource methods exist

    Details

    • Type: Task
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.0
    • Component/s: JAX-RS
    • Labels:
      None
    • Estimated Complexity:
      Unknown

      Description

      Consider the request "GET /root/book" and the following code:

      @Path("root")
      public class Root {
          @Path("book")
          public getSub() {return new Sub();}
      
          @Path("book")
          @POST
          public void addBook(Book book) {}
      }
      public class Sub {
         @GET
         public Book getBook() {}
      }
      

      CXF will dispatch the call to Sub.getBook().

      Unfortunately, JAX-RS matching algorithm is currently written such that the call will be rejected due to the fact the matching sub-resource is expected to be immediately discarded if the current root has methods matching the same path, even though these methods (such as addBook) may have no matching HTTP verbs.

      IMHO it is a JAX-RS algorithm limitation and I'm positive at the moment that this issue will be addressed as part of the JAX-RS 2.1 work. However CXF needs to support this behaviour by default for CXF to stay on the 'pure' JAX-RS 2.0 path.

      The contextual property to support the users depending on the current CXF approach will be introduced

        Activity

        There are no comments yet on this issue.

          People

          • Assignee:
            sergey_beryozkin Sergey Beryozkin
            Reporter:
            sergey_beryozkin Sergey Beryozkin
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development