title: Spring interceptor not working for partial REST endpoints
body: <p>I have a Spring Boot application with REST endpoints defined like this</p>
  
  <pre><code>/usermanagement/v1/access/ldap
  /usermanagement/v1/access/db
  </code></pre>
  
  <p>I have created a Spring Interceptor to intercept all incoming request with following pattern</p>
  
  <pre><code>@Override
  public void addInterceptors(InterceptorRegistry registry) {
     registry.addInterceptor(new RequestInterceptor()).addPathPatterns("/usermanagement/v1/**");
  }
  </code></pre>
  
  <p><strong>RequestInterceptor</strong></p>
  
  <pre><code>@Component
  public class RequestInterceptor extends HandlerInterceptorAdapter {
  
      @Override
      public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler)
          throws Exception {
          return true;
      }
  
      @Override
      public void postHandle(
          HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView)
          throws Exception {
          System.out.println("This is Post Handling the request");
      }
  }
  </code></pre>
  
  <p>This interceptor works only if client accesses the complete endpoint i.e</p>
  
  <blockquote>
    <p>/usermanagement/v1/access/ldap</p>
  </blockquote>
  
  <p>In case a partial endpoint is accessed,</p>
  
  <blockquote>
    <p>/usermanagement/v1/access</p>
  </blockquote>
  
  <p>interceptor is not called and a 404 is returned to the client.</p>
  
  <p>Is there a way to change this behavior? The reason I am doing this is because I don't want to expose specific endpoints but common endpoints and make internal calls to services and return result through common endpoints.</p>