<div dir="ltr">I added those 2 tests to RoutingHandlerTestCase:<div><br></div><div><pre style="color:rgb(0,0,0);font-family:&quot;dejavu sans mono&quot;;font-size:9pt"><span style="color:rgb(128,128,0)">@Test<br></span><span style="color:rgb(0,0,128);font-weight:bold">public void </span>testWildCardRoutingTemplateHandler2() <span style="color:rgb(0,0,128);font-weight:bold">throws </span>IOException {<br>    TestHttpClient client = <span style="color:rgb(0,0,128);font-weight:bold">new </span>TestHttpClient();<br>    <span style="color:rgb(0,0,128);font-weight:bold">try </span>{<br>        HttpGet  get = <span style="color:rgb(0,0,128);font-weight:bold">new </span>HttpGet(DefaultServer.<span style="font-style:italic">getDefaultServerURL</span>() + <span style="color:rgb(0,128,0);font-weight:bold">&quot;/wilder/test/card&quot;</span>);<br>        HttpResponse result = client.execute(get);<br>        Assert.<span style="font-style:italic">assertEquals</span>(StatusCodes.<span style="color:rgb(102,14,122);font-weight:bold;font-style:italic">OK</span>, result.getStatusLine().getStatusCode());<br>        Assert.<span style="font-style:italic">assertEquals</span>(<span style="color:rgb(0,128,0);font-weight:bold">&quot;wilder:[/test/card]&quot;</span>, HttpClientUtils.<span style="font-style:italic">readResponse</span>(result));<br><br>    } <span style="color:rgb(0,0,128);font-weight:bold">finally </span>{<br>        client.getConnectionManager().shutdown();<br>    }<br>}<br><br><span style="color:rgb(128,128,0)">@Test<br></span><span style="color:rgb(0,0,128);font-weight:bold">public void </span>testWildCardRoutingTemplateHandler3() <span style="color:rgb(0,0,128);font-weight:bold">throws </span>IOException {<br>    TestHttpClient client = <span style="color:rgb(0,0,128);font-weight:bold">new </span>TestHttpClient();<br>    <span style="color:rgb(0,0,128);font-weight:bold">try </span>{<br>        HttpGet  get = <span style="color:rgb(0,0,128);font-weight:bold">new </span>HttpGet(DefaultServer.<span style="font-style:italic">getDefaultServerURL</span>() + <span style="color:rgb(0,128,0);font-weight:bold">&quot;/wildestBeast&quot;</span>);<br>        HttpResponse result = client.execute(get);<br>        Assert.<span style="font-style:italic">assertEquals</span>(StatusCodes.<span style="color:rgb(102,14,122);font-weight:bold;font-style:italic">OK</span>, result.getStatusLine().getStatusCode());<br>        Assert.<span style="font-style:italic">assertEquals</span>(<span style="color:rgb(0,128,0);font-weight:bold">&quot;wildest:[Beast]&quot;</span>, HttpClientUtils.<span style="font-style:italic">readResponse</span>(result));<br><br>    } <span style="color:rgb(0,0,128);font-weight:bold">finally </span>{<br>        client.getConnectionManager().shutdown();<br>    }<br>}</pre><pre style="color:rgb(0,0,0);font-family:&quot;dejavu sans mono&quot;;font-size:9pt">Additional routes are:<br></pre><pre style="color:rgb(0,0,0);font-family:&quot;dejavu sans mono&quot;;font-size:9pt"><pre style="font-family:&quot;dejavu sans mono&quot;;font-size:9pt">.add(Methods.<span style="color:rgb(102,14,122);font-weight:bold;font-style:italic">GET</span>, <span style="color:rgb(0,128,0);font-weight:bold">&quot;/wilder/*&quot;</span>, <span style="color:rgb(0,0,128);font-weight:bold">new </span>HttpHandler() {<br>    <span style="color:rgb(128,128,0)">@Override<br></span><span style="color:rgb(128,128,0)">    </span><span style="color:rgb(0,0,128);font-weight:bold">public void </span>handleRequest(HttpServerExchange exchange) <span style="color:rgb(0,0,128);font-weight:bold">throws </span>Exception {<br>        exchange.getResponseSender().send(<span style="color:rgb(0,128,0);font-weight:bold">&quot;wilder:&quot; </span>+ exchange.getQueryParameters().get(<span style="color:rgb(0,128,0);font-weight:bold">&quot;*&quot;</span>));<br>    }<br>})<br>.add(Methods.<span style="color:rgb(102,14,122);font-weight:bold;font-style:italic">GET</span>, <span style="color:rgb(0,128,0);font-weight:bold">&quot;/wildest*&quot;</span>, <span style="color:rgb(0,0,128);font-weight:bold">new </span>HttpHandler() {<br>    <span style="color:rgb(128,128,0)">@Override<br></span><span style="color:rgb(128,128,0)">    </span><span style="color:rgb(0,0,128);font-weight:bold">public void </span>handleRequest(HttpServerExchange exchange) <span style="color:rgb(0,0,128);font-weight:bold">throws </span>Exception {<br>        exchange.getResponseSender().send(<span style="color:rgb(0,128,0);font-weight:bold">&quot;wildest:&quot; </span>+ exchange.getQueryParameters().get(<span style="color:rgb(0,128,0);font-weight:bold">&quot;*&quot;</span>));<br>    }<br>})</pre><pre style="font-family:&quot;dejavu sans mono&quot;;font-size:9pt"><br></pre><pre style="font-family:&quot;dejavu sans mono&quot;;font-size:9pt">Now the problem is that without a part representing the wildcard at the pathtemplate the <b>PathTemplateMatcher</b> doesn&#39;t work, and therefore the routing doesn&#39;t too.</pre><pre style="font-family:&quot;dejavu sans mono&quot;;font-size:9pt">However when I try to fix the <b>PathTemplate</b> the actual matching doesn&#39;t work.</pre><pre style="font-family:&quot;dejavu sans mono&quot;;font-size:9pt">I have no problem digging a bit and fixing this issue, I just want to know which class should be the preferred class to fix it.</pre><pre style="font-family:&quot;dejavu sans mono&quot;;font-size:9pt">Enhance the <b>PathTemplateMatcher#match</b> to handle the index of c correctly(which is complicated because wrong base in pathTemplates)</pre><pre style="font-family:&quot;dejavu sans mono&quot;;font-size:9pt">or fix <b>PathTemplate#matches </b>and <b>PathTemplate#create</b></pre><pre style="font-family:&quot;dejavu sans mono&quot;;font-size:9pt">I would be really happy to get some feedback, right now I feel more like mangling with the PathTemplate because it seems to be</pre><pre style="font-family:&quot;dejavu sans mono&quot;;font-size:9pt">called only at creation/instantiation time instead of the Matcher which is called with every request.</pre></pre></div></div>