code: private IDataSource getDataSource(HttpServletRequest request) throws DataSourceNotFoundException {
          String contextPath = request.getContextPath();
          String requestURI = request.getRequestURI();
  
          String path = contextPath == null
                  ? requestURI
                  : requestURI.substring(contextPath.length());
  
          if (path.equals("/") || path.isEmpty()) {
              final String baseURL = FragmentRequestParserBase.extractBaseURL(request, config);
              return new IndexDataSource(baseURL, dataSources);
          }
  
          String dataSourceName = path.substring(1);
          IDataSource dataSource = dataSources.get(dataSourceName);
          if (dataSource == null) {
              throw new DataSourceNotFoundException(dataSourceName);
          }
          return dataSource;
      }
docs: Get the datasource
  
  @param request
  @return
  @throws IOException