title: How to apply the PathPatternParser introduced in Spring 5?
body: <p>I want to create a <strong>GET</strong> request that takes a filepath as a path variable.</p>
  
  <p>As described in the Spring documentation found <a href="https://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/web/util/pattern/PathPattern.html" rel="noreferrer">here</a>, this should be possible by using the following: /resources/{*path}. </p>
  
  <p>I am using Spring Boot 2.1.2 which uses Spring 5.</p>
  
  <p>However when I set up my controller method like this, the request doesn't match the route. An expected matching path would be for example /resources/some/filepath which should lead the PathVariable "path" to be /some/filepath</p>
  
  <pre class="lang-java prettyprint-override"><code>  @GetMapping("/resources/{*path}")
    public String content(@PathVariable String path) {
      return null;
    }
  </code></pre>
  
  <p>I didn't find any information about any configuration that is needed in order to make use of the new PathPattern. The only other piece of information I found about this new feature is a post at Baeldung (<a href="https://www.baeldung.com/spring-5-mvc-url-matching" rel="noreferrer">https://www.baeldung.com/spring-5-mvc-url-matching</a>) which doesn't mention anything about configuration. So I expect that it should work out of the box, but it doesn't.</p>
  
  <p>I cloned the project mentioned in the Baeldung post. The corresponding unit tests run. When I copy the Controller method and the unit test to my project, it fails. So I expect that it has to do with configuration.</p>
  
  <p>Thank you for any help.</p>