title: How do I map a single file using ResourceHandlerRegistry and Spring MVC?
body: <p>I have a Spring MVC app where I define a static resource haandler like this:</p>
  
  <pre><code>@Override
  public void addResourceHandlers(ResourceHandlerRegistry registry) {
      if (resourceIdentifier != null) {
          registry.addResourceHandler("/admin-ui/**", "/admin-ui/").addResourceLocations(
                  "file:" + resourceIdentifier.getResourcesLocation() + "/");
      }
  }
  </code></pre>
  
  <p>(For brevity, I have elided the rest of the <code>HandlerInterceptor</code> declaration.)</p>
  
  <p>Now, the main entry point of the app is: </p>
  
  <pre><code>https://foo.mysite.com/admin-ui/index.html
  </code></pre>
  
  <p>Instead, I want the entry point to be:</p>
  
  <pre><code>https://foo.mysite.com/admin-ui
  </code></pre>
  
  <p>Currently, this gives a 404 error. What is the easiest way to enable this, preferably using the <code>ResourceHandlerRegistry</code>?</p>