鉴于此 UrlMapping:
"/foo/$foobar" {
controller = "foo"
action = "foo"
constraints {
}
}
结合这个控制器:
class FooController {
def foo = {
def foobar = params.foobar
println "foobar=" + foobar
}
}
并带着这些要求:
- http://localhost:8080/app/foo/example.com给出输出“foobar=example”
- http://localhost:8080/app/foo/examplecom给出输出“foobar=examplecom”
似乎 Grails 在第一个点(“.”)处削减了“foobar”参数。这是故意的吗?如果我想在我的 URL 映射中使用包含点的参数,是否有解决方法?