Details
-
Bug
-
Resolution: Obsolete
-
Minor
-
None
-
2.0.13.Final
-
None
Description
The following does not work:
Handlers.path() .addPrefixPath("/test", Handlers.routing().get("", ...).post("", ...)
You have to imagine I would supply the RoutingHandler from a function, and I just want to match whatever prefix it was put under.
The example crashes with "UT000071: Cannot add path template /, matcher already contains an equivalent pattern /".
It seems from the error message that an empty route "" is intepreted as "/". Weirdly, it seems possible to define two routes for "/":
Handlers.path() .addPrefixPath("/test", Handlers.routing().get("/", ...).post("/", ...)
This does not produce UT000071.
I'm not sure if this is a bug or not, but it does make my use case impossible. I want to have 'Controllers' defining their own routes. The are then to be 'mounted' under a prefix. It works if I resister them at "/", but then the URLs are a bit ugly, like POST /test/ instead of POST /test.