[英]i build url parameter using http_buid_query, how do i convert it back to array
[英]How do I create a URL with an array query parameter in Play Framework using Scala?
在使用 Scala 的 Play Framework 中,我想接受以下带有数组查询参数的 URL:
path?ids=1&ids=2
我在路由和 controller 中放什么来接受上面的 URL?
conf/routes
GET /path MyController.path(ids: ???)
MyController.scala
class MyController extends BaseController {
def path(ids: ???) = ??? // implement
}
conf/routes
GET /path MyController.path(ids: Seq[Long] ?= Seq.empty)
MyController.scala
class MyController extends BaseController {
def path(ids: Seq[Long]) = ??? // implement
}
请注意, ?=
在 URL 中使ids
成为可选。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.