I’m sorry – I guess my question is: is there a way to escape the : character in a route?
The point is that this works just as expected (using HABIBI as separator) – works both ways:
GET /wiki/$cat<[^:/]*>HABIBI$name<.+> controllers.Wiki.show2(cat, name, c=":")
So you basically recognize ANY string in there. However, this doesn’t work (using : as separator):
GET /wiki/$cat<[^:/]*>:$name<.+> controllers.Wiki.show2(cat, name, c=":")
Because the : has a special meaning for routes.
Thanks,
Razie
--
You received this message because you are subscribed to the Google Groups "play-framework" group.
To view this discussion on the web visit https://groups.google.com/d/msg/play-framework/-/PRin3ItFeocJ.
To post to this group, send email to play-fr...@googlegroups.com.
To unsubscribe from this group, send email to play-framewor...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/play-framework?hl=en.
Appreciate that – wondering though if there is a solution or we need a defect – I think this deserves a defect since the idea is in fact meant to work.
I see the parser for the routes uses this rule for the respective dynamic and static parts
def singleComponentPathPart: Parser[DynamicPart] = (":" ~> identifier) ^^ {
case name => DynamicPart(name, """[^/]+""")
}
def staticPathPart: Parser[StaticPart] = (not(":") ~> not("*") ~> not("$") ~> """[^\s]""".r +) ^^ {
case chars => StaticPart(chars.mkString)
}
While the path starts with the “bad” one so I couldn’t find a workaround
def path: Parser[PathPattern] = "/" ~ ((positioned(singleComponentPathPart) | positioned(multipleComponentsPathPart) | positioned(regexComponentPathPart) | staticPathPart) *) ^^ {
case _ ~ parts => PathPattern(parts)
--
You received this message because you are subscribed to the Google Groups "play-framework" group.
To view this discussion on the web visit https://groups.google.com/d/msg/play-framework/-/4_LofDghECQJ.