code: static MatchedRequest selectProvider(IncomingRequest request) throws HttpErrorPage {
          URI requestURI = UriUtils.createURI(request.getRequestLine().getUri());
          String host = UriUtils.extractHost(requestURI).toHostString();
          Header hostHeader = request.getFirstHeader(HttpHeaders.HOST);
          if (hostHeader != null) {
              host = hostHeader.getValue();
          }
          String scheme = requestURI.getScheme();
          String relativeUri = requestURI.getPath();
          String contextPath = request.getContextPath();
          if (!StringUtils.isEmpty(contextPath) && relativeUri.startsWith(contextPath)) {
              relativeUri = relativeUri.substring(contextPath.length());
          }
  
          Driver driver = null;
          UriMapping uriMapping = null;
          for (UriMapping mapping : instances.getUrimappings().keySet()) {
              if (mapping.matches(scheme, host, relativeUri)) {
                  driver = getInstance(instances.getUrimappings().get(mapping));
                  uriMapping = mapping;
                  break;
              }
          }
          if (driver == null) {
              throw new HttpErrorPage(HttpStatus.SC_NOT_FOUND, "Not found", "No mapping defined for this URI.");
          }
  
          if (driver.getConfiguration().isStripMappingPath()) {
              relativeUri = DriverFactory.stripMappingPath(relativeUri, uriMapping);
          }
  
          MatchedRequest context = new MatchedRequest(driver, relativeUri);
          LOG.debug("Selected {} for scheme:{} host:{} relUrl:{}", driver, scheme, host, relativeUri);
          return context;
      }
docs: Selects the Driver instance for this request based on the mappings declared in the configuration.
  
  @param request
  the incoming request
  
  @return a {@link MatchedRequest} containing the {@link Driver} instance and the relative URI
  
  @throws HttpErrorPage
  if no instance was found for this request