Google Groups

RE: [play-framework] Re: [2.0-scala] custom route with :


Razvan Cojocaru May 7, 2012 3:14 PM
Posted in group: play-framework

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)
      }

 

 

From: play-fr...@googlegroups.com [mailto:play-fr...@googlegroups.com] On Behalf Of biesior
Sent: May-04-12 3:22 PM
To: play-fr...@googlegroups.com
Subject: Re: [play-framework] Re: [2.0-scala] custom route with :

 

I don't know the way for escaping this char, so I suggested you a workaround :) that's all what I can do

W dniu piątek, 4 maja 2012 20:55:32 UTC+2 użytkownik Razvan Cojocaru napisał:

I’m sorry – I guess my question is: is there a way to escape the : character in a route?

 

--
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.
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.