title: Spring boot abstract Controller Request mapping
body: <p>I have the below setup in my Spring Boot app:</p>
  
  <pre><code>@RestController
  @RequestMapping ("/main/**")
  class Child extends Parent {
  // Child code
  }
  
  abstract class Parent {
  // Other code
  @RequestMapping ("/sub/**")
  public ResponseEntity handle(RequestEntity re) {
  
   // Expected to handle requests with path pattern /main/sub/**
  
  }
  </code></pre>
  
  <p>The goal is to have the handle() method in abstract Parent Controller to receive all incoming requests for the path pattern "/main/sub/**".</p>
  
  <p>But it's not working. Though it works if I place the handle method (from Parent Controller) inside the Child Controller along with its request mapping.</p>
  
  <p>Can someone help me identify what I'm missing here?</p>
  
  <p>More detailed code below as suggested by Ralf:</p>
  
  <pre><code>    @RestController
      @RequestMapping ("/main/**")
      class Child&lt;T&gt; extends Parent&lt;T&gt; {
      // Child code only overrides those methods defined in the parent, and has no request mapping for any method within this class. And it does not override the handle() method defined in parent.
      }
  
      abstract class Parent&lt;T&gt; {
      // Other code
      @RequestMapping ("/sub/**")
      public @ResponseBody ResponseEntity&lt;?&gt; handle(RequestEntity&lt;T&gt; re) {
       // Expected to handle requests with path pattern /main/sub/
      }
  }
  </code></pre>