<div dir="ltr">Thanks for the quick response.  This is exactly what I was looking for.<div><br></div><div>Bill</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Apr 15, 2014 at 7:27 PM, Jonathan Hart <span dir="ltr">&lt;<a href="mailto:jonathan.hart@gmail.com" target="_blank">jonathan.hart@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi everyone (new to this list)<div><br></div><div>Many thanks for making this, I was trying to do the EXACT same thing with Undertow and was having a very hard time wrapping my head around predicates. </div>

</div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Apr 14, 2014 at 5:38 PM, Stuart Douglas <span dir="ltr">&lt;<a href="mailto:sdouglas@redhat.com" target="_blank">sdouglas@redhat.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><br>
<br>
Bill O&#39;Neil wrote:<br>
&gt; I was curious what the best practices would be for url routing with many<br>
&gt; endpoints.<br>
&gt;<br>
&gt; For example<br>
&gt;<br>
&gt; POST /user/<br>
&gt; GET /user/{userId}<br>
&gt; GET /document/{documentId} ContentType=appliction/json (only respond<br>
&gt; when json is requested)<br>
&gt;<br>
&gt; What would be the best option for this? I was able to achieve most of<br>
&gt; what i wanted using the PredicatesHandler class. Is this a good choice?<br>
<br>
</div>That will work fine, although there are more efficient ways to do this.<br>
I think this will actually be a fairly common use case, so I have added<br>
a handler to handle this:<br>
<br>
<a href="https://github.com/undertow-io/undertow/commit/04385f29996673658bce3c131de4e0a32241e78e#diff-3" target="_blank">https://github.com/undertow-io/undertow/commit/04385f29996673658bce3c131de4e0a32241e78e#diff-3</a><br>


<br>
<br>
Basically it matches requests based on a combination of method, path<br>
template and predicate, and will be considerably more efficient that<br>
testing a list of predicates.<br>
<br>
Stuart<br>
<div><br>
<br>
<br>
&gt;<br>
&gt; This would build a List of PredicatedHandlers as well as the fall<br>
&gt; through handler which I would use as a 404. I got an example working<br>
&gt; using the text predicate format<br>
&gt;<br>
&gt; method[GET] and path-template[value=\&quot;/user/{userId}\&quot;]<br>
&gt;<br>
&gt;<br>
&gt; Is this a good approach or are there better recommendations?<br>
&gt;<br>
&gt;<br>
&gt; Thanks,<br>
&gt;<br>
&gt; Bill<br>
&gt;<br>
</div>&gt; _______________________________________________<br>
&gt; undertow-dev mailing list<br>
&gt; <a href="mailto:undertow-dev@lists.jboss.org" target="_blank">undertow-dev@lists.jboss.org</a><br>
&gt; <a href="https://lists.jboss.org/mailman/listinfo/undertow-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/undertow-dev</a><br>
_______________________________________________<br>
undertow-dev mailing list<br>
<a href="mailto:undertow-dev@lists.jboss.org" target="_blank">undertow-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/undertow-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/undertow-dev</a><br>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div>