相关疑难解决方法(0)

在Play 2路由中处理自由格式GET URL参数

假设我有一个可选择接受两个参数的动作:

def foo(name: String, age: Integer) = Action { 
  // name & age can both be null if not passed
}
Run Code Online (Sandbox Code Playgroud)

如何设置我的route文件以使用以下任何调用语法:

/foo
/foo?name=john
/foo?age=18
/foo?name=john&age=18
/foo?authCode=bar&name=john&age=18    // The controller may have other implicit parameters
Run Code Online (Sandbox Code Playgroud)

这个的正确语法是什么?

routing scala playframework playframework-2.1

9
推荐指数
1
解决办法
8862
查看次数

标签 统计

playframework ×1

playframework-2.1 ×1

routing ×1

scala ×1