title: Spring Boot Swagger HTML documentation is not getting displayed
body: <p>I am setting up a REST API / Micro-services project using Spring Boot. I am also trying to enable swagger documentation. When I run spring boot application, I am able to see browse to the localhost:8080/v2/api-docs and it returns API documentation. However, when I attempt browsing <a href="http://localhost:8080/documentation/swagger-ui.html" rel="nofollow noreferrer">http://localhost:8080/documentation/swagger-ui.html</a> or <a href="http://localhost:8080/swagger-ui.html" rel="nofollow noreferrer">http://localhost:8080/swagger-ui.html</a> browser does not display swagger UI documentation. </p>
  
  <p>I have included following dependencies in the pom file to enable documentation : </p>
  
  <pre><code>&lt;dependency&gt;
      &lt;groupId&gt;io.springfox&lt;/groupId&gt;
      &lt;artifactId&gt;springfox-swagger2&lt;/artifactId&gt;
      &lt;version&gt;2.8.0&lt;/version&gt;
  &lt;/dependency&gt;
  &lt;!-- https://mvnrepository.com/artifact/io.springfox/springfox-swagger-ui --&gt;
  &lt;dependency&gt;
      &lt;groupId&gt;io.springfox&lt;/groupId&gt;
      &lt;artifactId&gt;springfox-swagger-ui&lt;/artifactId&gt;
      &lt;version&gt;2.9.2&lt;/version&gt;
  &lt;/dependency&gt;
  </code></pre>
  
  <p>Also, I have create following swagger config class:</p>
  
  <pre><code>@Configuration
  @EnableSwagger2
  public class SwaggerConfig {
  
      @Bean
      public Docket api(){
          return new Docket(DocumentationType.SWAGGER_2);
      }
  }
  </code></pre>
  
  <p>The response I am seeing when trying to access <a href="http://localhost:8080/servlet-context" rel="nofollow noreferrer">http://localhost:8080/servlet-context</a> :</p>
  
  <pre><code>Whitelabel Error Page
  This application has no explicit mapping for /error, so you are seeing this as a fallback.
  
  Fri Dec 21 03:16:26 GMT 2018
  There was an unexpected error (type=Not Found, status=404).
  No message available
  </code></pre>
  
  <p>Server Logs :</p>
  
  <pre><code>2018-12-21 03:25:14.294 DEBUG 4049 --- [  restartedMain] o.s.c.e.PropertySourcesPropertyResolver  : Found key 'spring.liveBeansView.mbeanDomain' in PropertySource 'systemProperties' with value of type String
  2018-12-21 03:25:14.351  INFO 4049 --- [  restartedMain] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat started on port(s): 8080 (http) with context path ''
  2018-12-21 03:25:14.355  INFO 4049 --- [  restartedMain] c.xxxx.springboot.demo.DemoApplication   : Started DemoApplication in 3.951 seconds (JVM running for 4.723)
  2018-12-21 03:25:14.373 DEBUG 4049 --- [  restartedMain] o.s.boot.devtools.restart.Restarter      : Creating new Restarter for thread Thread[main,5,main]
  2018-12-21 03:25:14.373 DEBUG 4049 --- [  restartedMain] o.s.boot.devtools.restart.Restarter      : Immediately restarting application
  2018-12-21 03:25:14.373 DEBUG 4049 --- [  restartedMain] o.s.boot.devtools.restart.Restarter      : Created RestartClassLoader org.springframework.boot.devtools.restart.classloader.RestartClassLoader@1b3b349
  2018-12-21 03:25:14.373 DEBUG 4049 --- [  restartedMain] o.s.boot.devtools.restart.Restarter      : Starting application com.xxxx.springboot.demo.DemoApplication with URLs [file:/Users/XXXXX/XXXXX/SpringMicroservices/SpringBoot/demo/target/classes/]
  2018-12-21 03:25:14.763 DEBUG 4049 --- [on(2)-127.0.0.1] o.s.c.e.PropertySourcesPropertyResolver  : Found key 'local.server.port' in PropertySource 'server.ports' with value of type Integer
  2018-12-21 03:25:14.995  INFO 4049 --- [on(2)-127.0.0.1] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring DispatcherServlet 'dispatcherServlet'
  2018-12-21 03:25:14.995  INFO 4049 --- [on(2)-127.0.0.1] o.s.web.servlet.DispatcherServlet        : Initializing Servlet 'dispatcherServlet'
  2018-12-21 03:25:14.995 DEBUG 4049 --- [on(2)-127.0.0.1] o.s.web.servlet.DispatcherServlet        : Detected StandardServletMultipartResolver
  2018-12-21 03:25:14.995 DEBUG 4049 --- [on(2)-127.0.0.1] o.s.web.servlet.DispatcherServlet        : Detected AcceptHeaderLocaleResolver
  2018-12-21 03:25:15.003 DEBUG 4049 --- [on(2)-127.0.0.1] o.s.web.servlet.DispatcherServlet        : enableLoggingRequestDetails='false': request parameters and headers will be masked to prevent unsafe logging of potentially sensitive data
  </code></pre>
  
  <p>Please find below one of the controllers:</p>
  
  <pre><code>import org.springframework.beans.factory.annotation.Autowired;
  import org.springframework.hateoas.Resource;
  import org.springframework.hateoas.mvc.ControllerLinkBuilder;
  import org.springframework.http.ResponseEntity;
  import org.springframework.web.bind.annotation.*;
  import org.springframework.web.servlet.support.ServletUriComponentsBuilder;
  
  import javax.validation.Valid;
  import java.net.URI;
  import java.util.List;
  import static org.springframework.hateoas.mvc.ControllerLinkBuilder.*;
  
  @RestController
  public class UserResource {
  
      @Autowired
      private UserDaoService service;
  
      @GetMapping("/users")
      public List&lt;User&gt; retrieveAllUsers(){
          return service.findAll();
      }
  
      @GetMapping("/users/{id}")
      public Resource&lt;User&gt; retrieveUser(@PathVariable int id){
          User user = service.findOne(id);
          if(user==null)
              throw new UserNotFoundEception("id-" + id);
  
          Resource&lt;User&gt; resource = new Resource&lt;User&gt;(user);
          ControllerLinkBuilder linkTo = linkTo(methodOn(this.getClass()).retrieveAllUsers());
          resource.add(linkTo.withRel("all-users"));
          return resource;
      }
  
      @PostMapping("/users")
      public ResponseEntity&lt;Object&gt; CreateUser(@Valid @RequestBody User user){
          User savedUser = service.save(user);
          URI location = ServletUriComponentsBuilder
                  .fromCurrentRequest().path("/{id}")
                  .buildAndExpand(savedUser.getId())
                  .toUri();
  
          return ResponseEntity.created(location).build();
      }
  
      @DeleteMapping("/users/{id}")
      public void deleteUser(@PathVariable int id){
          User user = service.deleteById(id);
          if(user==null)
              throw new UserNotFoundEception("id-" + id);
      }
  }
  </code></pre>