code: @Override
      protected void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) {
          beanFactory.addBeanPostProcessor(new ServletContextAwareProcessor(servletContext));
          beanFactory.ignoreDependencyInterface(ServletContextAware.class);
          beanFactory.registerResolvableDependency(ServletContext.class, servletContext);
  
          WebApplicationContextUtils.registerWebApplicationScopes(beanFactory);
      }
docs: Register ServletContextAwareProcessor.
  @see ServletContextAwareProcessor