title: How to use a regex path mapper variable in a RequestMapping?
body: <p>I am trying to use a request mapper to match on urls like this:</p>
  
  <pre><code>http://localhost:9999/si/configs/some/path/on/the/server/file.xml
  </code></pre>
  
  <p>I have a controller set up like this, but the value of the <code>RequestMapping</code> of the <code>findConfig</code> method is incorrect.  Here is my code (stripped clean of everything extraneous):</p>
  
  <pre><code>@Controller
  @RequestMapping("/si/configs")
  public class SIController {
  
      @RequestMapping(value = "{path:/**/*.xml}", method = RequestMethod.GET)
      public ResponseEntity&lt;String&gt; findConfig(@PathVariable("path") String path) {
          // value of path arg should be: "/some/path/on/the/server/file.xml"
     }
  }
  </code></pre>
  
  <p>I know that Spring allows for regex's in path matching strings, and I tried to follow the advice of this question: <a href="https://stackoverflow.com/questions/9020444/spring-uri-template-patterns-with-regular-expressions">Spring URI Template Patterns with Regular Expressions</a>, but I can't seem to get this correct.</p>
  
  <p>What should go in the request mapping?</p>
  
  <hr>
  
  <p><strong>EDIT</strong></p>
  
  <p>When I remove the path variable and go with this:</p>
  
  <pre><code>    @RequestMapping(value = "/**/*.xml", method = RequestMethod.GET)
      public ResponseEntity&lt;String&gt; findConfig() {
      }
  </code></pre>
  
  <p>My controller method is invoked as expected.  So, there is something about trying to match on a path variable with wild crads that spring doesn't like.</p>