title: Spring Matrix Variables require at least one template variable to work?
body: <p>I've been trying to get a simple REST API to list contents of a collection and I'm using matrix variables to control the pagination.</p>
  
  <p>My controller has the following method to list contents of a collection:</p>
  
  <pre><code>@RequestMapping(
      value = "articles",
      method = RequestMethod.GET,
      produces = MediaType.APPLICATION_JSON_VALUE)
  public @ResponseBody ArticlePageRestApiResponse listArticles(
      @MatrixVariable(required = true, defaultValue = 100, value = "resultsPerPage") int resultsPerPage,
      @MatrixVariable(required = true, defaultValue = 0, value = "pageNumber") int pageNumber) {
  
      // some logic to return the collection
  
  }
  </code></pre>
  
  <p>If I then do a GET <a href="http://example.com/articles;resultsPerPage=22;pageNumber=33" rel="nofollow">http://example.com/articles;resultsPerPage=22;pageNumber=33</a> it fails to find a request mapping. I have enabled matrix variables support by adding the following:</p>
  
  <pre><code>@Configuration
  public class EnableUriMatrixVariableSupport extends WebMvcConfigurationSupport {
  
      @Override
      @Bean
      public RequestMappingHandlerMapping requestMappingHandlerMapping() {
          RequestMappingHandlerMapping hm = super.requestMappingHandlerMapping();
          hm.setRemoveSemicolonContent(false);
             return hm;
      }
  }
  </code></pre>
  
  <p>What I've found is that if the matrix variables are prefixed with at least one template variable then the matrix variables are correctly assigned. The following works but is ugly where I've had to make part of the URI path a template variable that is always going to be "articles" to trick the Request Mapping Handler into thinking there is at least one URI template variable :</p>
  
  <pre><code>@RequestMapping(
      value = "{articles}",
      method = RequestMethod.GET,
      produces = MediaType.APPLICATION_JSON_VALUE)
  public @ResponseBody ArticlePageRestApiResponse listArticles(
      @PathVariable("articles") String ignore,
      @MatrixVariable(required = true, defaultValue = 100, value = "resultsPerPage") int resultsPerPage,
      @MatrixVariable(required = true, defaultValue = 0, value = "pageNumber") int pageNumber) {
  
      // some logic to return the collection
  }
  </code></pre>
  
  <p>Have I found a bug or am I mis-understanding matrix variables?</p>