[undertow-dev] Docs for templates

Greg Hellings greg.hellings at gmail.com
Wed Sep 7 08:08:39 EDT 2016


Oliver,

I found it very difficult to work with the PathTemplateHandler and its
set of matching operations seemed very minimal to me. I also found no
efficient way to mix-and-match between full Paths and PathTemplate
entries. So I created my own handler class that gave the ability to
match based on both HTTP Verb and various path components.

https://github.com/greg-hellings/gully/blob/master/src/main/java/com/thehellings/gully/Router.java
https://github.com/greg-hellings/gully/blob/master/src/main/java/com/thehellings/gully/PlainRouter.java

I haven't used it extensively, but in my own local testing it seems to
work exactly the way I wanted - it's still just an HttpHandler
underneath, so it can be placed anywhere in a handler chain. And it
operates on the result of getRelativePath, so you can nest them within
each other, or place them within other components in a handler chain
and the class should operate properly.

The whole set of handler and its dependent classes should be available
as a Maven artifact if you want to play with it. If this sort of
functionality exists somewhere in core Undertow, I've been entirely
unable to decipher it and locate its functioning.

--Greg

On Tue, Sep 6, 2016 at 9:41 PM, Oliver Dain <oliver at analyticspot.com> wrote:
> Hey all,
>
> I haven't seen any documentation on the format of a template accepted by a
> PathTemplateHandler. I know the basics: "/foo", "/foo/{userId}", etc. but
> are wildcards allowed? Is there a way to specify a handler for anything with
> a certain prefix? If two handlers would match how is the tie broken, etc.
>
> Thanks,
> Oliver
> --
> CTO, Analytic Spot
> 44 West Broadway #222
> Eugene, OR 97401
> analyticspot.com • 425-296-6556
> www.linkedin.com/in/oliverdain
>
> _______________________________________________
> undertow-dev mailing list
> undertow-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/undertow-dev



More information about the undertow-dev mailing list