title: Spring Swagger2 integration ServletContext autowiring issue
body: <p>I'm running Spring 4 mvc with embedded Jetty 9.
  I tried to plug in Swagger2 tool, but I faced next exception </p>
  
  <p><code>Error creating bean with name 'documentationPluginsBootstrapper'</code></p>
  
  <p>the root cause of this exception is </p>
  
  <pre><code>nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [javax.servlet.ServletContext] found for dependency [javax.servlet.ServletContext]: expected at least 1 bean which qualifies as autowire candidate for this dependency.
  </code></pre>
  
  <p>This is my SwaggerConfigClass</p>
  
  <pre><code>@Configuration
  @EnableSwagger2
  public class SwaggerConfig {
      private static final Logger logger = Logger.getLogger(SwaggerConfig.class);
  
      @Bean
      public Docket api() {
          return new Docket(DocumentationType.SWAGGER_2)
                  .select()
                  .apis(RequestHandlerSelectors.any())
                  .paths(PathSelectors.any())
                  .build()
                  .apiInfo(apiInfo());
      }
  
      private ApiInfo apiInfo() {
          return new ApiInfoBuilder()
                  .title("TITLE")
                  .description("DESCRIPTION")
                  .version("VERSION")
                  .termsOfServiceUrl("http://terms-of-services.url")
                  .license("LICENSE")
                  .licenseUrl("http://url-to-license.com")
                  .build();
      }
  }
  </code></pre>
  
  <p>After that I created factory class</p>
  
  <pre><code>public class ServletContextFactory implements FactoryBean&lt;ServletContext&gt;,
          ServletContextAware {
      private ServletContext servletContext;
  
     @Override
      public ServletContext getObject() throws Exception {
          return servletContext;
      }
  
      @Override
      public Class&lt;?&gt; getObjectType() {
          return ServletContext.class;
      }
  
      @Override
      public boolean isSingleton() {
          return true;
      }
  
      @Override
      public void setServletContext(ServletContext servletContext) {
          this.servletContext = servletContext;
      }
  
  }
  </code></pre>
  
  <p>and then manually used it in redeclared bean</p>
  
  <pre><code>@Bean
  public DocumentationPluginsBootstrapper documentationPluginsBootstrapper(DocumentationPluginsManager documentationPluginsManager,  
                                                                           List&lt;RequestHandlerProvider&gt; handlerProviders,
                                                                           DocumentationCache scanned,
                                                                           ApiDocumentationScanner resourceListing,
                                                                           TypeResolver typeResolver,
                                                                           Defaults defaults) throws Exception {
  
      return new DocumentationPluginsBootstrapper(documentationPluginsManager,
              handlerProviders,
              scanned,
              resourceListing,
              typeResolver,
              defaults,
              new ServletContextFactory().getObject());
  }
  </code></pre>
  
  <p>but still had an exception (another exception) NullPointerException as next </p>
  
  <p><code>Failed to start bean 'documentationPluginsBootstrapper'; nested exception is java.lang.NullPointerException</code></p>
  
  <p>So can anyone suggest some solution of this autowiring problem?</p>