title: Spring URI PathVariable with file extension not working
body: <p>I'm having trouble working out why the file extension (.jpg) in the following request is being stripped before calling my controller method:</p>
  
  <pre><code>GET http://blah.com/assets/picture.jpg
  </code></pre>
  
  <p>I've set the content negotiation to not favour path extensions:</p>
  
  <pre><code>@Configuration
  @EnableWebMvc
  @ComponentScan(basePackages = { "com.blah" })
  public class PlatformWebAppConfig extends WebMvcConfigurerAdapter {    
  
      public void configureContentNegotiation(ContentNegotiationConfigurer configurer) {    
          configurer.favorPathExtension(false);
          configurer.favorParameter(false);
          configurer.useJaf(false);
          configurer.defaultContentType(MediaType.APPLICATION_JSON);
      }
  }
  </code></pre>
  
  <p>my controller is this:</p>
  
  <pre><code>@Controller
  public class FileUploadRestApi {
      @RequestMapping(
          value = "/assets/{filename}",
          method = RequestMethod.GET)
      public void downloadFile(HttpServletResponse response,
          @PathVariable("filename") String filename,
          Principal principal) {
              // ERROR: 'filename' has extension stripped !!!!
      }
  }
  </code></pre>
  
  <p>I've also tried adding the following to the <code>PlatformWebAppConfig</code> class above with no luck:</p>
  
  <pre><code>@Override
  public void configurePathMatch(PathMatchConfigurer matcher) {
      matcher.setUseSuffixPatternMatch(true);
      matcher.setUseRegisteredSuffixPatternMatch(true);
  }
  </code></pre>
  
  <p>I've tried to debug the issue and I've got as far as seeing <code>ContentNegotiationManagerFactoryBean.afterPropertiesSet</code> is definitely seeing the <code>favorPathExtension</code> setting as false and not setting up a content negotiation strategy (as expected). </p>
  
  <p><strong>Update:</strong></p>
  
  <p>If I change the request mapping to   </p>
  
  <pre><code>"/assets/{filename:.+}"
  </code></pre>
  
  <p>the filename will include the extensions but this does not explain why setting all those configurers did not achieve anything????</p>