Scala
PlayFramework

playframeworkのroutingでListを受ける

More than 1 year has passed since last update.


playframeworkのrouteで受けれるのは以下の型


Play 2.x supports the following query string parameter types:

String

Char

Int

Integer (Java)

Long (Scala and Java)

Double (Scala and Java)

Float (Scala and Java)

Boolean (Scala and Java)

java.util.UUID

Option

Optional (Java)

Seq

List (Scala and Java)

Array

See Binders.scala for all supported types.


http://stackoverflow.com/questions/31684919/how-to-route-map-like-parameters-in-get-request-with-play




routes定義


routes

GET    /hoge/list    @controllers.HogeController.list(query: List[String])



Controller定義


HogeController.scala

def list(query: List[String])



クエリ

/hoge/fuga?query=AAAA&query=BBBB


参考