title: Request Mappings, leave out specific cases instead of catching all
body: <h2>Introduction</h2>
  
  <p>We have has created a request mapping as the following:</p>
  
  <pre><code>@RequestMapping(path = "/{project}/{resource}/{language}", method = RequestMethod.GET)
  public ResponseEntity&lt;Resource&gt; get(
          @PathVariable String project, 
          @PathVariable String resource, 
          @PathVariable String language) throws IOException {
  </code></pre>
  
  <p>We could change the path and add a prefix in order to avoid issues but this has been decided as unwanted.</p>
  
  <pre><code>path = "/generateReport/{project}/{resource}/{language}"
  </code></pre>
  
  <p>Unfortunately, this current mapping is creating problems with swagger-ui.html. 
  When we call it from: <a href="http://localhost:8023/swagger-ui.html" rel="nofollow noreferrer">http://localhost:8023/swagger-ui.html</a> , the page is blank because all the requests that follow the format <code>a/b/c</code> are hijacked.</p>
  
  <p>Examples:</p>
  
  <pre><code>  &lt;link rel="stylesheet" type="text/css" href="webjars/springfox-swagger-ui/springfox.css?v=2.8.0-SNAPSHOT" &gt;
    &lt;link rel="stylesheet" type="text/css" href="webjars/springfox-swagger-ui/swagger-ui.css?v=2.8.0-SNAPSHOT" &gt;
    &lt;link rel="icon" type="image/png" href="webjars/springfox-swagger-ui/favicon-32x32.png?v=2.8.0-SNAPSHOT" sizes="32x32" /&gt;
    &lt;link rel="icon" type="image/png" href="webjars/springfox-swagger-ui/favicon-16x16.png?v=2.8.0-SNAPSHOT" sizes="16x16" /&gt;
  </code></pre>
  
  <p>And</p>
  
  <pre><code>&lt;script src="webjars/springfox-swagger-ui/swagger-ui-bundle.js?v=2.8.0-SNAPSHOT"&gt; &lt;/script&gt;
  &lt;script src="webjars/springfox-swagger-ui/swagger-ui-standalone-preset.js?v=2.8.0-SNAPSHOT"&gt; &lt;/script&gt;
  &lt;script src="webjars/springfox-swagger-ui/springfox.js?v=2.8.0-SNAPSHOT"&gt; &lt;/script&gt;
  </code></pre>
  
  <h2>Question</h2>
  
  <p>So how do i deal with this? Is there a way to specify that requests starting with <code>webjars</code> should be re-directed elsewhere?</p>
  
  <p>I tried using the <code>consumes</code> keyword, and this works in terms of the client (though I don't like using the content-type like this).</p>
  
  <p><code>consumes = MediaType.APPLICATION_JSON_VALUE</code> .</p>
  
  <p>Unfortunately, now I am getting the following when I try to access swagger-ui.html :</p>
  
  <pre><code>DefaultHandlerExceptionResolver Resolved exception caused by Handler execution: org.springframework.web.HttpMediaTypeNotSupportedException: Content type '' not supported
  </code></pre>
  
  <p>The HTML is being generated for swagger-ui.html, but all the resources it needs cannot be loaded.</p>
  
  <p><strong>Any ideas?</strong></p>
  
  <h2>Update</h2>
  
  <p>I found a work around using path variables and regular expressions:</p>
  
  <pre><code>@RequestMapping(path = "/{project:^(?!webjars).+}/{resource}/{language}", method = RequestMethod.GET)
  public ResponseEntity&lt;Resource&gt; get(
          @PathVariable String project, 
          @PathVariable String resource, 
          @PathVariable String language) throws IOException {
  </code></pre>
  
  <p><strong>However, new answers are still appreciated as I don''t like this 100%</strong></p>