<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;" dir="ltr">
<p style="margin-top:0;margin-bottom:0">Hi,</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">I define two template paths with the following implementation:</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0"></p>
<div><span style="font-size: 12pt;">public class UndertowTwoPathVariablesApplication {</span><br>
</div>
<div><br>
</div>
<div>&nbsp; private static final Logger LOGGER = LoggerFactory.getLogger(UndertowTwoPathVariablesApplication.class);</div>
<div><br>
</div>
<div>&nbsp; public static void main(final String[] args) {</div>
<div><br>
</div>
<div>&nbsp; &nbsp; Undertow.builder()</div>
<div>&nbsp; &nbsp; &nbsp; .addHttpListener(8080, &quot;localhost&quot;)</div>
<div>&nbsp; &nbsp; &nbsp; .setHandler(</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Handlers.routing()</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .get(&quot;/api/v1/orders/{orderId}/items/&quot;, (exchange) -&gt; {</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; LOGGER.info(&quot;The path template defined is '/api/v1/orders/{orderId}/items/'&quot;);</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; LOGGER.info(&quot;The request URI '{}'&quot;, exchange.getRequestURI());</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; exchange.getResponseHeaders().put(Headers.CONTENT_TYPE, &quot;text/plain&quot;);</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; exchange.setStatusCode(StatusCodes.OK)</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .getResponseSender().send(&quot;Retrieve all Items of the Order '&quot;</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#43; exchange.getQueryParameters().get(&quot;orderId&quot;).getLast() &#43; &quot;'&quot;);</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; })</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .get(&quot;/api/v1/orders/{orderId}/items/{itemId}&quot;, (exchange) -&gt; {</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; LOGGER.info(&quot;The path template defined is '/api/v1/orders/{orderId}/items/{itemId}'&quot;);</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; LOGGER.info(&quot;The request URI '{}'&quot;, exchange.getRequestURI());</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; exchange.getResponseHeaders().put(Headers.CONTENT_TYPE, &quot;text/plain&quot;);</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; exchange.setStatusCode(StatusCodes.OK)</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .getResponseSender().send(</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &quot;Retrieve the Item '&quot; &#43; exchange.getQueryParameters().get(&quot;itemId&quot;).getLast()</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#43; &quot;' of the Order '&quot; &#43; exchange.getQueryParameters().get(&quot;orderId&quot;).getLast() &#43; &quot;'&quot;);</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }))</div>
<div>&nbsp; &nbsp; &nbsp; .build()</div>
<div>&nbsp; &nbsp; &nbsp; .start();</div>
<div><br>
</div>
<div>&nbsp; }</div>
<div><br>
</div>
<div>}</div>
<div><br>
</div>
And using the version 2.0.0.Beta1 of undertow-core I can not enter to the first Handler defined.
<p></p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0"></p>
<div>boggard@xiuhcoatl:~$ curl -v 'http://localhost:8080/api/v1/orders/12345/items'</div>
<div>*&nbsp; &nbsp;Trying 127.0.0.1...</div>
<div>* TCP_NODELAY set</div>
<div>* Connected to localhost (127.0.0.1) port 8080 (#0)</div>
<div>&gt; GET /api/v1/orders/12345/items HTTP/1.1</div>
<div>&gt; Host: localhost:8080</div>
<div>&gt; User-Agent: curl/7.58.0</div>
<div>&gt; Accept: */*</div>
<div>&gt;</div>
<div>&lt; HTTP/1.1 404 Not Found</div>
<div>&lt; Connection: keep-alive</div>
<div>&lt; Content-Length: 0</div>
<div>&lt; Date: Fri, 02 Feb 2018 08:08:48 GMT</div>
<div>&lt;</div>
<div>* Connection #0 to host localhost left intact</div>
<br>
<p></p>
<p style="margin-top:0;margin-bottom:0"></p>
<div>boggard@xiuhcoatl:~$ curl -v 'http://localhost:8080/api/v1/orders/12345/items/'</div>
<div>*&nbsp; &nbsp;Trying 127.0.0.1...</div>
<div>* TCP_NODELAY set</div>
<div>* Connected to localhost (127.0.0.1) port 8080 (#0)</div>
<div>&gt; GET /api/v1/orders/12345/items/ HTTP/1.1</div>
<div>&gt; Host: localhost:8080</div>
<div>&gt; User-Agent: curl/7.58.0</div>
<div>&gt; Accept: */*</div>
<div>&gt;</div>
<div>&lt; HTTP/1.1 200 OK</div>
<div>&lt; Connection: keep-alive</div>
<div>&lt; Content-Type: text/plain</div>
<div>&lt; Content-Length: 41</div>
<div>&lt; Date: Fri, 02 Feb 2018 08:09:15 GMT</div>
<div>&lt;</div>
<div>* Connection #0 to host localhost left intact</div>
<div>Retrieve the Item '' of the Order '12345'</div>
<br>
<p></p>
<p style="margin-top:0;margin-bottom:0"></p>
<div>boggard@xiuhcoatl:~$ curl -v 'http://localhost:8080/api/v1/orders/12345/items/'</div>
<div>*&nbsp; &nbsp;Trying 127.0.0.1...</div>
<div>* TCP_NODELAY set</div>
<div>* Connected to localhost (127.0.0.1) port 8080 (#0)</div>
<div>&gt; GET /api/v1/orders/12345/items/ HTTP/1.1</div>
<div>&gt; Host: localhost:8080</div>
<div>&gt; User-Agent: curl/7.58.0</div>
<div>&gt; Accept: */*</div>
<div>&gt;</div>
<div>&lt; HTTP/1.1 200 OK</div>
<div>&lt; Connection: keep-alive</div>
<div>&lt; Content-Type: text/plain</div>
<div>&lt; Content-Length: 41</div>
<div>&lt; Date: Fri, 02 Feb 2018 08:09:15 GMT</div>
<div>&lt;</div>
<div>* Connection #0 to host localhost left intact</div>
<div>Retrieve the Item '' of the Order '12345'</div>
<p></p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">This not happen when the path have just one path variable. I create the repo&nbsp;<a href="https://github.com/b0gg4rd/undertow-path-variable" class="OWAAutoLink" id="LPlnk490938" previewremoved="true">https://github.com/b0gg4rd/undertow-path-variable</a>&nbsp;with
 the two implementations.</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<p style="margin-top:0;margin-bottom:0">Best Regards</p>
<p style="margin-top:0;margin-bottom:0"><br>
</p>
<div id="Signature">Fernando Cruz<br>
<br>
</div>
</div>
</body>
</html>