title: setServletContext not activating inside @Configuration file
body: <p>So, this is something of a follow-on of <a href="https://stackoverflow.com/questions/50047521/how-to-get-access-to-servletcontext-inside-of-an-configuration-or-springbootap">this question</a>.  My current code looks something like this:</p>
  
  <pre><code>@Configuration
  @EnableAutoConfiguration
  @ComponentScan(basePackages = {"base.pkg.name"})
  public class MyApp implements ServletContextAware {
  
      private ThingDAO beanThingDAO = null;
  
      public MyApp() {
          // Lots of stuff goes here.
          // no reference to servletContext, though
          // beanThing gets initialized, and mostly populated.
      }
  
      @Bean publicD ThingDAO getBeanThingDAO() { return beanThingDAO; }
  
      public void setServletContext(ServletContext servletContext) {
          // all references to servletContext go here, including the
          // bit where we call the appropriate setters in beanThingDAO
      {
  }
  </code></pre>
  
  <p>The problem is, it's not working.  Specifically, my understanding was that setServletContext was supposed to be called by various forms of Spring Magic at some point during the startup process, but (as revealed by System.out.println()) it never gets called.  I'm trying to finish up the first stage of a major bunch of refactoring, and for the moment it is of notable value to me to be able to handle the access to servletContext entirely inside of the @Configuration file.  I'm not looking for an answer that will tell me that I should put it in the controllers.  I'm looking for an answer that will either tell me how to get it working inside of the @Configuration file, or explain why that won't work, and what I can do about it.</p>