code: private void loadWebConfigs(Environment environment, SpringConfiguration config, ApplicationContext appCtx) throws ClassNotFoundException {
          // Load filters.
          loadFilters(config.getFilters(), environment);
  
          // Load servlet listener.
          environment.servlets().addServletListeners(new RestContextLoaderListener((XmlRestWebApplicationContext) appCtx));
  
          // Load servlets.
          loadServlets(config.getServlets(), environment);
      }
docs: Load filter, servlets or listeners for WebApplicationContext.